OS X - Having Trouble With NGinx, PHP and MySQL

For the longest time I’ve been developing off of a remote server. I’ve decided to take advantage of many of the benefits of moving my workflow to local development.

In the past I’ve had MAMP and XAMPP installed on my Macbook (OSX - 10.7). After having these installed I realized that they are running old versions of PHP and MySQL.

I successfully installed Homebrew. Using homebrew I installed NGinx, MySQL and PHP56.

I must also note that I ran the XAMPP uninstaller and move MAMP to trash and deleted.

[PROBLEM 1] I then restarted. Now in terminal when I run php -v it says I’m running PHP 5.3 form /usr/bin/php. How do I get my machine to run PHP 5.6 ( /usr/local/Cellar/php56 )

[PROBLEM 2] When brewing PHP 56 I failed to include --with-mysql. Is this something I can change in the config and then recompile?

[PROBLEM 3] I can render HTML in my localhost document root but when I try to run index.php or any other php file it gives me “File Not Found”

Any suggestions are appreciated.

I found a solution to my Problem #1.

On my mac osx bash paths were stores in /etc/paths (not ~/.bash_profile or ~/.profile). I added the path to my latest php version (/usr/local/Cellar/php56/5.6.9/bin) to this file and re-opened terminal only to be filled with excitement.

Hope this helps someone else.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.