Setting up Apache + PHP + MySQL on OSX with Homebrew

10 thoughts on “Setting up Apache + PHP + MySQL on OSX with Homebrew”

  1. So, I’ve followed all these steps and everything looks to be in place. However, when I enter “apachectl start” as best I can tell, its still the native OS X copy of apache thats running. Is this a PATH issue? Greatful for any help you can offer.

    1. Paul you are probably missing something like this in your .bash_profile:

      Notice the added /usr/local paths. I don’t remember if brew does this automatically, specially the sbin path.

      Restart your terminal and try again, you can see which version is being used with:
      which apachectl

  2. Thanks for this!

    I had to install php with `–homebrew-apxs` to avoid the following cryptic error when starting apache:

    httpd: Syntax error on line 117 of /usr/local/etc/apache2/2.2/httpd.conf: Cannot load /usr/local/Cellar/php56/5.6.3/libexec/apache2/ into server: dlopen(/usr/local/Cellar/php56/5.6.3/libexec/apache2/, 10): Symbol not found: _ap_unixd_config\n Referenced from: /usr/local/Cellar/php56/5.6.3/libexec/apache2/\n Expected in: /usr/local/Cellar/httpd22/2.2.29/bin/httpd\n in /usr/local/Cellar/php56/5.6.3/libexec/apache2/

Leave a comment

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s