Sonerezh / sonerezh

A self-hosted, web-based application to stream your music, everywhere.
https://www.sonerezh.bzh
GNU Affero General Public License v3.0
767 stars 122 forks source link

Compatibility with PHP 7.3 #372

Closed hcl closed 4 years ago

hcl commented 5 years ago

It seems that the CakePHP version (2.10.11) packaged in the released package is out of date. When I tried to deployed it under nginx/1.16.0 + PHP 7.3.6, the installation process can't be finished and generates tons of NOTICE messages(like below) both in the browser and log.

[error] 18108#0: *25 FastCGI sent in stderr: "ction.php on line 128PHP message: PHP Notice:  compact() [<a href='http://php.net/function.compact'>function.compact</a>]: Undefined variable: subject in /var/www/sonerezh/app/Vendor/cakephp/cakephp/lib/Cake/Utility/ObjectCollection.php on line 128PHP message: PHP Notice:  compact() [<a href='http://php.net/function.compact'>function.compact</a>]: Undefined variable: subject in /var/www/sonerezh/app/Vendor/cakephp/cakephp/lib/Cake/Utility/ObjectCollection.php on line 128 PHP message: PHP Notice:  compact() [<a href='http://php.net/function.compact'>function.compact</a>]: Undefined variable: subject in /var/www/sonerezh/app/Vendor/cakephp/cakephp/lib/Cake/Utility/ObjectCollection.php on line 128

PHP 7.3 has changed the behavior of function compact(). Luckily, CakePHP have had fixed the compatibility with PHP 7.3.x in the recent update. I have tested with the latest version(2.10.18), and Sonerezh seems work and has no problems.

It can be done with (suppose you have composer.phar under the Sonerezh folder):

php composer.phar update

After the update, Sonerezh will work under PHP 7.3.

So I hope that the official providing package could update as well.

butlerfr commented 4 years ago

Thanks hcl ! It's working for me in a brand new debian10 install!

If you don't know composer (like me), it can be installed very simply:

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
php -r "if (hash_file('sha384', 'composer-setup.php') === 'a5c698ffe4b8e849a443b120cd5ba38043260d5c4023dbf93e1558871f1f07f58274fc6f4c93bcfd858c6bd0775cd8d1') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
php composer-setup.php
php -r "unlink('composer-setup.php');"

execute it in the root folder of sonerezh (/var/www/sonerezh for me) cf : https://getcomposer.org/download/

lGuillaume124 commented 4 years ago

Hi,

I published a new release, thank you for your report :+1: (and sorry for the delay)