cachet icon indicating copy to clipboard operation
cachet copied to clipboard

Failing to deploy on PHP 5.6

Open eveandcats opened this issue 11 years ago • 2 comments

Currently getting following error:

Generating optimized autoload files
PHP Parse error:  syntax error, unexpected '[', expecting ')' in /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/react/promise/src/functions.php on line 68
PHP Stack trace:
PHP   1. {main}() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/artisan:0
PHP   2. require() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/artisan:16
PHP   3. require() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/bootstrap/autoload.php:17
PHP   4. ComposerAutoloaderInit4d73418afec9fbbb9e59fdeb8b7d28a8::getLoader() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/autoload.php:7
PHP   5. composerRequire4d73418afec9fbbb9e59fdeb8b7d28a8() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/composer/autoload_real.php:49
PHP   6. require() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/composer/autoload_real.php:58
Script php artisan optimize handling the post-install-cmd event returned with an error



  [RuntimeException]                                                                                                                                                                          
  Error Output: PHP Parse error:  syntax error, unexpected '[', expecting ')' in /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/react/promise/src/functions.ph  
  p on line 68                                                                                                                                                                                
  PHP Stack trace:                                                                                                                                                                            
  PHP   1. {main}() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/artisan:0                                                                                           
  PHP   2. require() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/artisan:16                                                                                         
  PHP   3. require() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/bootstrap/autoload.php:17                                                                          
  PHP   4. ComposerAutoloaderInit4d73418afec9fbbb9e59fdeb8b7d28a8::getLoader() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/autoload.php:7                    
  PHP   5. composerRequire4d73418afec9fbbb9e59fdeb8b7d28a8() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/composer/autoload_real.php:49                       
  PHP   6. require() /var/lib/openshift/550b92394382ec66d0000177/app-root/runtime/repo/web/vendor/composer/autoload_real.php:58

Tested with react/promise 2.2/2.1 & php 5.6.4

eveandcats avatar Mar 21 '15 14:03 eveandcats

What's your setup? I'm running PHP 5.6.0 and it's working fine. Since it's react that seems to be causing the error, I'd suggest it's your environment.

jbrooksuk avatar Mar 21 '15 19:03 jbrooksuk

After a few more looks, problem solved,

The installation was done on Redhat Openshift with a custom php. On a closer look at composer.json, composer tries to run the system-installed php which does not work with Cachet.

Manually modifying the commands to reflect the proper php binary fixes things, so I fixed my $PATH to point at the right php binary

Thanks for your help :)

eveandcats avatar Mar 25 '15 04:03 eveandcats