Can Heroku Foreman be used with PHP?

I am developing a PHP application on Heroku. Is it possible to use Foreman to test my application? Wherever I look, I find links to Ruby, but nothing for PHP.

+4
source share
1 answer

Yes, using the PHP 5.4 embedded web server:

sudo foreman start -f Procfile_dev 

And in Procfile_dev:

 web: php -S 127.0.0.1:80 -t /path/to/doc/root 

This is how I develop locally. I also have a line worker: watchr watcher.rb that listens for file changes to combine / minimize JS, compile SCSS, etc.

Perhaps you can add db: /usr/bin/mysqld or the like to start mysql if necessary.

ALSO: you will want to install the Heroku Config add-on , in which the application keys will be written to the .env file that Forman will send to the php server at startup (accessible via getenv, like on Heroku.)

+3
source

Source: https://habr.com/ru/post/1441018/


All Articles