Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error on installation using php 7.4.4 #768

Closed
elaur opened this issue May 14, 2020 · 4 comments
Closed

Error on installation using php 7.4.4 #768

elaur opened this issue May 14, 2020 · 4 comments
Labels

Comments

@elaur
Copy link

elaur commented May 14, 2020

How Shlink is set-up

  • Shlink Version: 2.2.1
  • PHP Version: 7.4.4
  • How do you serve Shlink: Self-hosted OpenLiteSpeed
  • Database engine used: MariaDB
  • OS: Debian 10

Summary

sudo -u lsadm /usr/local/lsws/lsphp74/bin/lsphp ./install
PHP Fatal error: strict_types declaration must be the very first statement in the script in /usr/local/lsws/mydomain.cc/html/bin/install on line 3

Fatal error: strict_types declaration must be the very first statement in the script in /usr/local/lsws/mydomain.cc/html/bin/install on line 3

Any solutions to fix it?

@elaur elaur added the question label May 14, 2020
@elaur elaur changed the title Error on instalation using php 7.4.4 Error on installation using php 7.4.4 May 14, 2020
@acelaya
Copy link
Member

acelaya commented May 14, 2020

I'm not sure what this lsphp thing is, but it looks like it is performing some kind of code style check.

I would recommend you running Shlink with a regular PHP binary. That will solve the problem.

@acelaya
Copy link
Member

acelaya commented May 15, 2020

Hey @elaur

I have done a bit of research, and it looks like this error could be caused by the fact that this is a CLI script and stats with the shebang.

Could you try removing the #!/usr/bin/env php line at the beginning of the install script and see if it helps?

@elaur
Copy link
Author

elaur commented May 15, 2020

Hmm, got this

sudo -u lsadm /usr/local/lsws/lsphp74/bin/lsphp ./install

Welcome to Shlink!!
This tool will guide you through the installation process.

DATABASE

Select database type [MySQL]:
[0] MySQL
[1] MariaDB
[2] PostgreSQL
[3] MicrosoftSQL
[4] SQLite

PHP Warning: Use of undefined constant STDIN - assumed 'STDIN' (this will throw an Error in a future version of PHP) in /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Helper/QuestionHelper.php on line 107

Warning: Use of undefined constant STDIN - assumed 'STDIN' (this will throw an Error in a future version of PHP) in /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Helper/QuestionHelper.php on line 107
PHP Warning: feof() expects parameter 1 to be resource, string given in /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Helper/QuestionHelper.php on line 254

Warning: feof() expects parameter 1 to be resource, string given in /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Helper/QuestionHelper.php on line 254
PHP Warning: fread() expects parameter 1 to be resource, string given in /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Helper/QuestionHelper.php on line 255

Warning: fread() expects parameter 1 to be resource, string given in /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Helper/QuestionHelper.php on line 255
PHP Fatal error: Uncaught TypeError: Return value of Shlinkio\Shlink\Installer\Config\Option\Database\DatabaseUserConfigOption::askRequired() must be of the type string, null returned in /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Util/AskUtilsTrait.php:20
Stack trace:
#0 /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Config/Option/Database/DatabaseUserConfigOption.php(22): Shlinkio\Shlink\Installer\Config\Option\Database\DatabaseUserConfigOption->askRequired()
#1 /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Config/ConfigGenerator.php(58): Shlinkio\Shlink\Installer\Config\Option\Database\DatabaseUserConfigOption->ask()
#2 /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Command/InstallCommand.php(77): Shlinkio\Shlink\Installer\Config\ConfigGenerator->generateConfigInteractively()
#3 /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Command/Command.php(255): Shlinkio\Shlink\Installer\Command\InstallCommand->execute()
#4 /usr/local/lsws/mywebsite.cc/htm in /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Util/AskUtilsTrait.php on line 20

Fatal error: Uncaught TypeError: Return value of Shlinkio\Shlink\Installer\Config\Option\Database\DatabaseUserConfigOption::askRequired() must be of the type string, null returned in /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Util/AskUtilsTrait.php:20
Stack trace:
#0 /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Config/Option/Database/DatabaseUserConfigOption.php(22): Shlinkio\Shlink\Installer\Config\Option\Database\DatabaseUserConfigOption->askRequired()
#1 /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Config/ConfigGenerator.php(58): Shlinkio\Shlink\Installer\Config\Option\Database\DatabaseUserConfigOption->ask()
#2 /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Command/InstallCommand.php(77): Shlinkio\Shlink\Installer\Config\ConfigGenerator->generateConfigInteractively()
#3 /usr/local/lsws/mywebsite.cc/html/vendor/symfony/console/Command/Command.php(255): Shlinkio\Shlink\Installer\Command\InstallCommand->execute()
#4 /usr/local/lsws/mywebsite.cc/htm in /usr/local/lsws/mywebsite.cc/html/vendor/shlinkio/shlink-installer/src/Util/AskUtilsTrait.php on line 20

@acelaya
Copy link
Member

acelaya commented May 15, 2020

It's hard to say, but it looks like everything is related with the PHP variation you are using.

I would recommend using a regular PHP distribution, as some of these errors are happening on third party code that I will not be able to change.

I will close this for now, and consider supporting lite speed PHP in the future.

@acelaya acelaya closed this as completed May 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants