shlinkio / shlink

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

Unable to Update #749

Closed benhartwich closed 4 years ago

benhartwich commented 4 years ago

Hi,

when I try to update from version v2.0.2 to the latest 2.1.4 with bin/update I get:

PHP Parse error: syntax error, unexpected '$isUpdate' (T_VARIABLE), expecting ')' in /var/www/shortener/htdocs/shlink/vendor/shlinkio/shlink-installer/bin/run.php on line 12

How can I fix this?

acelaya commented 4 years ago

Looks like you are running the bin/update script with a PHP binary lower than v7.4, which is the minimum required version since Shlink v2.0.0

My guess is that you have several php binaries, and the wrong one is being picked up.

This is the result when running the script with PHP 7.3

image

And this is the result with PHP 7.4

image

The reason is that the script is using an arrow function, which is not supported in previous PHP versions.

benhartwich commented 4 years ago

Yes, you´re right, but now I know, why I rolled back to the old version. After the update to the latest version I cannot access any stats of any link:

`2020/05/05 08:45:03 [error] 30002#30002: *132723 FastCGI sent in stderr: "PHP message: PHP Fatal error: Uncaught LogicException: The specified directory path "/var/www/shortener/htdocs/shlink.orig/module/Core/config/../templates" does not exist. in /var/www/shortener/htdocs/shlink/vendor/league/plates/src/Template/Folder.php:72 Stack trace:

0 /var/www/shortener/htdocs/shlink/vendor/league/plates/src/Template/Folder.php(39): League\Plates\Template\Folder->setPath()

1 /var/www/shortener/htdocs/shlink/vendor/league/plates/src/Template/Folders.php(31): League\Plates\Template\Folder->__construct()

2 /var/www/shortener/htdocs/shlink/vendor/league/plates/src/Engine.php(115): League\Plates\Template\Folders->add()

3 /var/www/shortener/htdocs/shlink/vendor/mezzio/mezzio-platesrenderer/src/PlatesRenderer.php(78): League\Plates\Engine->addFolder()

4 /var/www/shortener/htdocs/shlink/vendor/mezzio/mezzio-platesrenderer/src/PlatesRendererFactory.php(64): Mezzio\Plates\PlatesRenderer->addPath()

5 /var/www/shortener/htdocs/shlink/vendor/laminas/laminas-servicemanager/src/ServiceM" while reading response header from upstream`

acelaya commented 4 years ago

Can you open an new issue for this?

Let's try to keep one topic per issue, so that it's easier for other users to find information in closed tickets.

I will close this one, as the original issue seems to have been sorted out.

jacobrosenfeld commented 3 years ago

I'm having the same issue on a clean install on php 7.4.21 image