apioo / fusio

Open source API management platform
https://www.fusio-project.org
Apache License 2.0
1.86k stars 222 forks source link

Could not install backend app v3.1.1 [installBackendApp] #467

Open Cale-Torino opened 2 years ago

Cale-Torino commented 2 years ago

Apache 2.4, PHP 8 & MySQL 5.6

Running a LAMP stack

Composer version 1.10.26 2022-04-13 16:39:56

PRETTY_NAME="Debian GNU/Linux 10 (buster)" NAME="Debian GNU/Linux" VERSION_ID="10" VERSION="10 (buster)" VERSION_CODENAME=buster ID=debian HOME_URL="https://www.debian.org/" SUPPORT_URL="https://www.debian.org/support" BUG_REPORT_URL="https://bugs.debian.org/"

Once I submit version 3.1.1 to a sub domain in my hosting site I was able to install up to the installBackendApp part then I get the error alert:

Screenshot 2022-07-12 153033

str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string

So I'm not sure why there's such an issue installing on buster

chriskapp commented 2 years ago

Hi, ok, which concrete PHP version do you use it is 8.1 or 8.0? In general the error message seems strange since we use explicit for both arguments arrays s. https://github.com/apioo/fusio/blob/master/public/install.php#L213

Cale-Torino commented 2 years ago

Thanks for getting back to me so quickly.

I tried the install process again using PHP Version 8.1.8 still the same issue

I see that the escapeQuotedString() method is not even called when the installBackendApp() kicks in so that shouldn't be a problem but yet it's str_replace()

Also I did some further investigating:

I have a shared hosting account and it seems my SSH non-sudo user account has only PHP 7.4.30 however I can still change the PHP version in the domains config file.


email response from the hosting team:

Thank you for your email.

Running the "php --version" command displays the default PHP version of the hosting server and not of the individual domain. Each domain has its own PHP configuration file where these settings are stored. To upgrade your domain to PHP8.1 you would need to do so via the PHP Config Tool in konsoleH:


I have set PHP 8.1 in their konsoleH

Also I have been able to install WordPress on PHP 8.1 using the domain so there should be no problem however I am wondering if there is a potential issue between the SSH accounts versions and the domains versions


Image of konsoleH setup

Screenshot 2022-07-12 231054


Image of SSH user PHP version

Screenshot 2022-07-12 165735

Man it's so frustrating because it was working so well locally

I may have to try install an older version such as v2.1.9 just to see if it works

Cale-Torino commented 2 years ago

So I came up with a solution but it's a bit of a hack job however it should help anyone who has a similar issue.

Install as usual from install.php via the web browser and get the error.

Could not install backend app, you can install the backend app later on using the command bin/fusio marketplace:install fusio str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string

You can then ignore the error and manually install backend app.

NB: Keep in mind I had to use PHP 7.4.30 because of how my hosting company is setup :rage: .

Explanation: Even though the domains are running PHP 8.1.8 I had to install fusio v2.1.9 (PHP7 support) because the hosting server instance running PHP 7.4.30 was the bottleneck.

I couldn't manually install fusio v3.1.1 because it's using php8 and when you SSH into the hosting instance it's running PHP 7.4.30, hopefully it's clear enough.

SSH in and run php bin/fusio marketplace:install fusio in the apps root dir to install backed app manually.

Connect to backend app via the url and it works I can login.

Now in order to use the new PHP8 version... I have to wait for the hosting company to make PHP8 their minimum default on their hosting server instances or purchase a dedicated self managed server.

This may just be a rare problem but it wasted time so I think it's worth this small explanation.