Setting Up Symfony Dev Environment in Heroku

Viewed 440

So as the title suggests, I am setting up a Symfony project in heroku. It is on my Mac OSX laptop. I followed the directions here to set it up. I got everything installed, pushed my project to heroku, tested it and it works on the web.

Now I'm trying to set up the local dev environment. I would like to be able to simply use heroku local to launch the dev server as usual. I installed the heroku php buildpack, and I created a Procfile with these contents:

web: $(composer config bin-dir)/heroku-php-apache2 web/

the composer config bin-dir command returns vendor/bin, and then I can see that heroku-php-apache2 file in there. Everything looks good.

When I run heroku local I get this error:

[WARN] No ENV file found 
15:48:49 web.1   |  This program requires Apache 2.4.10 or newer with mod_proxy and mod_proxy_fcgi enabled; check your 'httpd' command. 
15:48:49 web.1   Exited with exit code 1

So I checked the httpd -v and I have:

Server version: Apache/2.4.27 (Unix) 
Server built:   Oct  3 2017 10:26:24

I just enabled (uncommented) mod_proxy and mod_proxy_fcgi in the /etc/apache2/httpd.conf file and restarted the machine, but still seeing the same error. I am starting to think it is a problem with my Procfile or something.

Any help is greatly appreciated.

1 Answers

For anyone having a similar problem, I was able to fix the issue. The issue WAS that I edited the wrong httpd.conf file, since I installed the apache from homebrew.

The path /etc/apache2/httpd.conf is correct if you are using the default apache2 installation on the mac. If you installed apache from homebrew like I did, you will find the httpd.conf file at /usr/local/etc/httpd/httpd.conf.

You need to uncomment the 2 lines for mod_proxy and mod_proxy_fcgi and also uncomment the port listener directive, since heroku likes to listen on non-default port 5000 and heroku will automatically do that at run time.

Also the server cannot be running already when you use heroku local.

:-)

Related