shlinkio / shlink

The definitive self-hosted URL shortener
https://shlink.io
MIT License
3.16k stars 254 forks source link

failing installation // PHP Fatal Error: InstallCommand.php:90 #210

Closed marvinpoo closed 6 years ago

marvinpoo commented 6 years ago

Trying a fresh install, getting this error. Afterall I think the installment is (based on the previous issues) way to user unfriendly. Maybe should think about an installer that also checks the needed additions, as said in #152 // or make the install readme more detailed.

By saying "Setup the application by running the bin/install script." it first confused me, too, and took me half an hour until I figured out this is not really an installer but more of an commandline enhancer to install/compile the script.

Anyway, back to my problem:

PHP Fatal error:  Uncaught TypeError: Return value of Shlinkio\Shlink\CLI\Command\Install\InstallCommand::configure() must be an instance of Shlinkio\Shlink\CLI\Command\Install\void, none returned in /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Command/Install/InstallCommand.php:90
Stack trace:
#0 /var/www/vhosts/xxx.xxx/httpdocs/vendor/symfony/console/Command/Command.php(77): Shlinkio\Shlink\CLI\Command\Install\InstallCommand->configure()
#1 /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Command/Install/InstallCommand.php(77): Symfony\Component\Console\Command\Command->__construct()
#2 /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Factory/InstallApplicationFactory.php(50): Shlinkio\Shlink\CLI\Command\Install\InstallCommand->__construct(Object(Zend\Config\Writer\PhpArray), Object(Symfony\Component\Filesystem\Filesystem), Object(Shlinkio\Shlink\CLI\Install\ConfigCustomizerManager), false)
#3 /var/www/vhosts/xxx.xxx/httpdocs/vendor/zendframework/zend-servicemanager/src/ServiceManager.php(764): Shlinkio\Shlink\CLI\Fact in /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Command/Install/InstallCommand.php on line 90

It was throwing out the error befor and after I installed the required APCu. So I have no idea what is stopping the installation.

Sys:

acelaya commented 6 years ago

I'm afraid that error means you are not really using PHP 7.2, but 7.0 or older. That's why it does not get "void" as a reserved word, and instead it tries to load it as a class.

Many people has faced this problem before. Make sure you run the installer with the proper PHP version

marvinpoo commented 6 years ago

I'm afraid that error means you are not really using PHP 7.2, but 7.0 or older. That's why it does not get "void" as a reserved word, and instead it tries to load it as a class.

Many people has faced this problem before. Make sure you run the installer with the proper PHP version

I freshly set up a host with a fresh 7.2 php install. My server has 7.0.30 as lowest php installation and the package I am using for shlink is using 7.2.10 FPM, should I maybe use 7.2.10 FastCGI?

acelaya commented 6 years ago

It might be that you are using the proper version from the web context (the fpm), but not from the command line.

You can check by running php -v

marvinpoo commented 6 years ago

PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies with the ionCube PHP Loader (enabled) + Intrusion Protection from ioncube24.com (unconfigured) v10.0.3, Copyright (c) 2002-2017, by ionCube Ltd. with Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

acelaya commented 6 years ago

There you have the problem. It's PHP 7.0

marvinpoo commented 6 years ago

I'm on it. If I get it running, let me check if I can get it to work now.

marvinpoo commented 6 years ago

Okay, this form of installation is honestly the worst I have ever experienced. I love the product, really the best link shortner I've ever used but the installation, you really have to fix that, it took me 2 hours in general to even make the installation starting with all preperation without the knowledge of a certified sysadmin.

I am very sure that the extreme lack of user experience of your installation process is the man key factor your awesome programm isn't far spread.

Now that I got your installation running, it only needed my one single type to f* over the whole installation and letting me redo the whole process after removing it all again.

Short: I got it working, but please rework your installation process, it is horrible. Great product anyway. Thank you so much.

marvinpoo commented 6 years ago

nevermind: last click on install:

`PHP Fatal error: Uncaught Error: Undefined class constant 'MYSQL_ATTR_INIT_COMMAND' in /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Model/CustomizableAppConfig.php:263 Stack trace:

0 /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Command/Install/InstallCommand.php(142): Shlinkio\Shlink\CLI\Model\CustomizableAppConfig->getArrayCopy()

1 /var/www/vhosts/xxx.xxx/httpdocs/vendor/symfony/console/Command/Command.php(251): Shlinkio\Shlink\CLI\Command\Install\InstallCommand->execute(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

2 /var/www/vhosts/xxx.xxx/httpdocs/vendor/symfony/console/Application.php(886): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))

3 /var/www/vhosts/xxx.xxx/httpdocs/vendor/symfony/console/Application.php(262): Symfony\Component\Console\Application->doRunCommand(Object(Shlinkio\Shlink\CLI\Command\Install\InstallCommand), Object(Symfony\C in /var/www/vhosts/xxx.xxx/httpdocs/module/CLI/src/Model/CustomizableAppConfig.php on line 263`

acelaya commented 6 years ago

Well, to be honest, I don't have to do anything.

You have probably noticed this software is completely free of charge, which not only includes the software itself, but also some support from my side, and the will to implement missing features and help as much as I can.

However I work on this on my free time (mostly weekends, vacation periods and a few hours from Monday to Friday), which means there's always going to be missing things and parts that can be improved.

It's easy to spot what's not working, what made you waste two hours of your time. What's not that easy is being able to see what's actually working (I have "wasted" hundreds of hours on this, but you are welcome).

In the future you should learn some manners when dealing with free and open source software maintainers, and remember that they don't work for you.

Any constructive feedback is always welcome but not like this.