Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

jhandayan's avatar

Error on Composer.phar update on deployment server

Hi guys, I need help. I got error upon running composer.phar update on my deployment server under hostnine.

I've got this error:

php artisan clear-compiled Script php artisan clear-compiled handling the pre-update-cmd event returned with an error

[RuntimeException]
Error Output:

update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [packages1] ... [packagesN]

Please need some advice

Thanks

0 likes
6 replies
danmatthews's avatar

Hi there, i've come across this a good few times, check that:

  • There are no service providers listed in your config/app.php that you don't have the packages installed for.
  • That the storage directory, and the appropriate subdirectories are writeable.
  • Check the php error log if you can, you can type php -i | grep error to display info on where PHP errors might be being logged if you don't know.

Also, sometimes i find that just deleting the vendor folder and the composer.lock file (depending on your deployment setup), then running composer install from scratch fixes most errors.

jhandayan's avatar

I also got this error in my artisan file in my error log

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

jhandayan's avatar

I already did what you advice but still get the error Script php artisan clear-compiled handling the post-install-cmd event returned with an error

[RuntimeException]
Error Output:

sid405's avatar

Regarding this :

PHP Parse error: syntax error, unexpected 'class' (T_CLASS), expecting identifier (T_STRING) or variable (T_VARIABLE) or '{' or '$'

Which version of php are you using on that server? Keep in mind that laravel 5.1 requires

"php": ">=5.5.9",

Hoe that helps.

Best.

s.

jhandayan's avatar

My php version in my local is 5.5.27 which is the composer works fine. In my deployment server php version is 5.5.28

Please or to participate in this conversation.