While testing the CLI Update Documentation,
for example, this command:
php cli/joomla.php check-updates
I keep having this error:
parse error, expecting `';'' or `'{'' in /libraries/src/Exception/ExceptionHandler.php on line 37
Possibly related:
[4.0] Load the document properly in the exception handler by laoneo · Pull Request #22913 · joomla/joomla-cms
#22913
Tested with and without this PR though, no change.
MacOS
PHP 7.2.5
Composer v 1.7.2
Node v 10.12.0
NPM v 5.10.0
That's the 3.9 line @PhilETaylor. In 4.0 line 37 is a method declaration which uses PHP 7 scalar and return typehints.
@ghazal Make sure your CLI PHP binary is running the expected version (as web and CLI can be running two different PHP versions).
In that case maybe the CLI code needs to be doing a PHP Version sanity check before running commands?
:-)
... Make sure your CLI PHP binary is running the expected version (as web and CLI can be running two different PHP versions).
That's what I suspected.
My computer runs on PHP 5.6.30
My bitnami stack on PHP 7.2.5
The joomla package reads PHP 5.6.30
If I update composer.json to PHP 7.2.5 (having removed composer.lock before) and run
composer install
again, the joomla package reads PHP 7.2.5 allright.
But thephp whatever
command still throws that error.
I guess I'll have to follow your advice (check CLI PHP binary) or maybe update the php version on this computer.
Thanks for your replies.
Status | New | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2018-11-10 18:35:20 |
Closed_By | ⇒ | ghazal |
Not really resolved, but OK. I'll reopen it if necessary.
Finally, I used this binary package to update my global PHP version :
https://php-osx.liip.ch/
Symfony is grumbling now.
"I'll get it one day, I'll get it."
Status | Closed | ⇒ | New |
Closed_Date | 2018-11-10 18:35:20 | ⇒ | |
Closed_By | ghazal | ⇒ |
If you are on a mac, checkout the Homebrew implementation of PHP which allows easy installation of multiple versions of PHP and the ability to switch between them.
see the PHP section of https://getgrav.org/blog/macos-mojave-apache-multiple-php-versions which explains how.
@PhilETaylor
Thanks.
I use Homebrew but have been stumped by their recent deprecation of php tap.
Gonna test this tut.
yeah that was a pain in the arse... but it all seems to be stable again now.
Status | New | ⇒ | Information Required |
Yes.
Status | Information Required | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2019-03-04 18:27:12 |
Closed_By | ⇒ | ghazal |
/libraries/src/Exception/ExceptionHandler.php on line 37 looks good to me
joomla-cms/libraries/src/Exception/ExceptionHandler.php
Line 37 in d67e585