0
votes

I'm testing out Yii 2.0 on an OpenShift instance running a scalable app with PHP 5.4 but all i'm getting is a 503 Service Unavailable error.

Looking in the php log there's the following line but i dont understand what the problem is, and i was hoping somebody could let me know.

[Sat Aug 16 10:03:38 2014] [error] [client ~ip~] PHP Fatal error: require(): Failed opening required '/var/lib/openshift/~instance~/app-root/runtime/repo/web/../vendor/autoload.php' (include_path='.:/var/lib/openshift/~instance~/app-root/runtime/repo/lib:/var/lib/openshift/~instance~/app-root/runtime/repo/libs:/var/lib/openshift/~instance~/app-root/runtime/repo/libraries:/var/lib/openshift/~instance~/app-root/runtime/repo/src:/var/lib/openshift/~instance~/app-root/runtime/repo/vendor:/var/lib/openshift/~instance~/app-root/runtime/repo/vendors:/var/lib/openshift/~instance~/php/phplib/pear/pear/php:/usr/share/pear') in /var/lib/openshift/~instance~/app-root/runtime/repo/web/index.php on line 7 - - - [16/Aug/2014:10:03:38 -0400] "GET / HTTP/1.0" 500 - "-" "-"

I already posted this on the Yii forum here but since on my local machine its working ok I figured that perhaps someone with more openshift experience might understand better the issue.

Regards,

1
Did you triple-check that mentioned file is really there (and it's readable)? For it's an autoload.php I assume this is a wrong path problem.Tomasz Kowalczyk
i dont understand what the problem is apparently the file /var/lib/openshift/~instance~/app-root/runtime/repo/vendor/autoload.php doesn't exist or is not readable - error messages usually mean exactly what they say =). Did you forget to run composer dumpautoload ?AD7six
Yeah, thanks. That was it. Got intimidated by how long that error line was ;-)skyplusplus
So, it seems i need to do some reading on what this composer thing is cause i had a vendor and an assets folder excluded in gitignore. i got it to work by copying them to the server. However, if they are ignored in git there must be a reason and i guess i need to find this out tooskyplusplus

1 Answers

0
votes

503 Service Unavailable means that the PHP app is not running, the app is not listening on the exposed service port, you must figure out why it is not running first, if the container restarts continuously causing you unable to proceed with the troubleshooting, you may start a debug terminal for the pod.