?
avatar ghazal
ghazal
10 Nov 2018

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

avatar ghazal ghazal - open - 10 Nov 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Nov 2018
avatar PhilETaylor
PhilETaylor - comment - 10 Nov 2018

/libraries/src/Exception/ExceptionHandler.php on line 37 looks good to me

avatar mbabker
mbabker - comment - 10 Nov 2018

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).

avatar PhilETaylor
PhilETaylor - comment - 10 Nov 2018

In that case maybe the CLI code needs to be doing a PHP Version sanity check before running commands?

avatar mbabker
mbabker - comment - 10 Nov 2018

ffc8f3b adds the PHP version check and minimum PHP constant to the cli/joomla.php script.

avatar PhilETaylor
PhilETaylor - comment - 10 Nov 2018

:-)

avatar ghazal
ghazal - comment - 10 Nov 2018

... 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 the php 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.

avatar Quy
Quy - comment - 10 Nov 2018

@ghazal Please close issue if resolved.

avatar ghazal ghazal - change - 10 Nov 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-11-10 18:35:20
Closed_By ghazal
avatar ghazal
ghazal - comment - 10 Nov 2018

Not really resolved, but OK. I'll reopen it if necessary.

avatar ghazal ghazal - close - 10 Nov 2018
avatar ghazal
ghazal - comment - 14 Nov 2018

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."

avatar ghazal ghazal - change - 14 Nov 2018
Status Closed New
Closed_Date 2018-11-10 18:35:20
Closed_By ghazal
avatar ghazal ghazal - reopen - 14 Nov 2018
avatar PhilETaylor
PhilETaylor - comment - 14 Nov 2018

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.

avatar ghazal
ghazal - comment - 14 Nov 2018

@PhilETaylor
Thanks.
I use Homebrew but have been stumped by their recent deprecation of php tap.
Gonna test this tut.

avatar PhilETaylor
PhilETaylor - comment - 14 Nov 2018

yeah that was a pain in the arse... but it all seems to be stable again now.

avatar franz-wohlkoenig franz-wohlkoenig - change - 4 Mar 2019
Status New Information Required
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

@ghazal can this Issue be closed?

avatar ghazal
ghazal - comment - 4 Mar 2019

Yes.

avatar ghazal ghazal - close - 4 Mar 2019
avatar ghazal ghazal - change - 4 Mar 2019
Status Information Required Closed
Closed_Date 0000-00-00 00:00:00 2019-03-04 18:27:12
Closed_By ghazal
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 4 Mar 2019

thanks @ghazal

Add a Comment

Login with GitHub to post a comment