Can you try to run /opt/plesk/php/7.1/bin/php composer.phar install --no-scripts ?
Jan 31, 2017
5
Level 5
PHP artisan fails, php cli version issue
Hello,
I'm not sure how to put in the right title. But I'm running Laravel on a VPS with Plesk and has default php 5.4.16 on the CLI, however the site itself is running on PHP 7.1
No when I want to run php artisan, I need to do the following:
$ /opt/plesk/php/7.1/bin/php artisan
In this way I can run any version of php on the CLI. Running php artisan this way is also fine.
But when I run composer install, I'm getting an error:
$ /opt/plesk/php/7.1/bin/php composer.phar install
Output:
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
Nothing to install or update
Generating autoload files
> php artisan clear-compiled
PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$' in /var/www/vhosts/domain/httpdocs/artisan on line 31
Script php artisan clear-compiled handling the post-install-cmd event returned with error code 255
I think it is a php cli version issue. Does anyone has some experience with this?
Level 3
3 likes
Please or to participate in this conversation.