I'm creating a Yii 2 application and trying it on Heroku
The document root should be the web/ folder of that application
This is what I've tried:
- Create a Procfile in the root of that application
web: sh www/config/web-boot.sh
- Create web-boot.sh in config folder
echo "Include /app/www/config/httpd/*.conf" >> /app/apache/conf/httpd.conf touch /app/apache/logs/error_log touch /app/apache/logs/access_log tail -F /app/apache/logs/error_log & tail -F /app/apache/logs/access_log & export LD_LIBRARY_PATH=/app/php/ext export PHP_INI_SCAN_DIR=/app/www echo "Launching apache" exec /app/apache/bin/httpd -DNO_DETACH
- From the config folder, I create "httpd" folder, and "default.conf" inside that folder
DocumentRoot "/app/www/web" <Directory "/app/www/web"> Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory>
and when I deploy the app, I get this error:
An error occurred in the application and your page could not be served. Please try again in a few moments. If you are the application owner, check your logs for details.
When I check the logs :
2014-07-12T20:23:08.476411+00:00 heroku[web.1]: State changed from starting to crashed 2014-07-12T20:23:06.313554+00:00 heroku[web.1]: Starting process with command `sh www/config/web-boot.sh` 2014-07-12T20:23:08.465571+00:00 heroku[web.1]: Process exited with status 2 2014-07-12T20:23:10.025168+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=richy-rich.herokuapp.com request_id=e4bb1124-5f2d-4a27-8df4-6fff9bc166b2 fwd="50.19.158.232" dyno= connect= service= status=503 bytes= 2014-07-12T20:41:49.308914+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=richy-rich.herokuapp.com request_id=5785ac83-c4fb-473e-b794-50ce491512c9 fwd="223.255.224.107" dyno= connect= service= status=503 bytes=
How to fix this ? I don't understands that Procfile at all, thanks
UPDATE
Now I tried another solution, I add this package to my composer.json
heroku/heroku-buildpack-php
And changed the Procfile into:
web: vendor/bin/heroku-php-nginx web/
This time I got this error:
2014-07-12T21:12:58.960392+00:00 app[web.1]: This program requires PHP 5.5.11 or newer; check your 'php' command. 2014-07-12T21:13:00.147518+00:00 heroku[web.1]: State changed from starting to crashed 2014-07-12T21:12:58.044158+00:00 heroku[web.1]: Starting process with command `vendor/bin/heroku-php-apache2 web/` 2014-07-12T21:13:00.136787+00:00 heroku[web.1]: Process exited with status 1 2014-07-12T21:13:08.648874+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=richy-rich.herokuapp.com request_id=a3bcc52d-2a7c-45ac-b21d-f856154d7e38 fwd="223.255.224.107" dyno= connect= service= status=503 bytes=
Seems like this is because of my PHP version, since the version installed by heroku is 5.5.10, so I tried updating the composer php version into ">=5.5.11", but I got another error (Man, This is 4.39 AM and I haven't sleep yet because of all these errors)
Problem 1 - The requested package php could not be found in any version, there may be a typo in the package name. Problem 2 - The requested package php could not be found in any version, there may be a typo in the package name. Problem 3 - Installation request for cebe/markdown 0.9.x-dev -> satisfiable by cebe/markdown[0.9.x-dev]. - cebe/markdown 0.9.x-dev requires php >=5.4.0 -> no matching package found. Problem 4 - Installation request for ezyang/htmlpurifier v4.6.0 -> satisfiable by ezyang/htmlpurifier[v4.6.0]. - ezyang/htmlpurifier v4.6.0 requires php >=5.2 -> no matching package found. Problem 5 - Installation request for swiftmailer/swiftmailer 5.2.x-dev -> satisfiable by swiftmailer/swiftmailer[5.2.x-dev]. - swiftmailer/swiftmailer 5.2.x-dev requires php >=5.2.4 -> no matching package found. Problem 6 - Installation request for swiftmailer/swiftmailer dev-master -> satisfiable by swiftmailer/swiftmailer[dev-master]. - swiftmailer/swiftmailer dev-master requires php >=5.2.4 -> no matching package found. Problem 7 - Installation request for yiisoft/yii2 2.0.0-beta -> satisfiable by yiisoft/yii2[2.0.0-beta]. - yiisoft/yii2 2.0.0-beta requires php >=5.4.0 -> no matching package found. Problem 8 - yiisoft/yii2 2.0.0-beta requires php >=5.4.0 -> no matching package found. - yiisoft/yii2-swiftmailer 2.0.0-beta requires yiisoft/yii2 * -> satisfiable by yiisoft/yii2[2.0.0-beta]. - Installation request for yiisoft/yii2-swiftmailer 2.0.0-beta -> satisfiable by yiisoft/yii2-swiftmailer[2.0.0-beta].
please kindy help me, thanks