What is the best way to set up your PHP development environment on Mac?

When I do PHP, I use XAMPP to set up the development environment on Windows , and then upload it to Linux servers, it works very well.

Now I am passing the PHP project to the person who has the Mac , so he needs a local PHP environment. I noticed XAMPP has a Mac version that I recommend.

But, knowing that the Mac is always a little different , someone used any other simple PHP environment setup tool for Mac, or I could even assume that the Mac solves this problem more elegantly , for example with a web server ready for first boot, etc. .d.

What is the best way to set up your PHP development environment on Mac?

+5
source share
4 answers

I personally use Macports to set up the PHP development environment. I guess this is not the best solution right now, as it requires a little more configuration than a complete solution like Xampp, but it gives you a little more flexibility.

Macports

Once you have installed this (remember to install the Unix Xcode tools first), you can easily install the packages. For instance:

sudo port install apache2
sudo port install php5 +apache2 
sudo port install mysql5

You can also easily add modules:

sudo port install php5-curl

I installed Apache as follows (found this on stackoverflow), so I don’t need to constantly change the apache conf file every time the project starts.

NameVirtualHost *:80

<VirtualHost *:80>
        ServerName *.dev
        VirtualDocumentRoot "/Users/les/Documents/workspace/%-2+/site/html"
</VirtualHost>

/etc/hosts apache:

127.0.0.1       merchant.dev

/Users/les/Documents/workspace/merchant/site/html

, .bash_profile

alias ap='sudo /opt/local/apache2/bin/apachectl'
alias apconfig='mate /opt/local/apache2/conf/httpd.conf'
alias hostconfig='mate /etc/hosts'
alias dsclean='find . -name ".DS_Store" -depth -exec rm {} \;'

mate - , textmate ( mac) dsclean - -, svn Mac.

+4

, MAMP. -, : MAMP

userguide MAMP, : Userguide

+3
+1

All you have to do is activate the web server in System Preferences> Separate, put your files in ~ / Sites, and you're good to go. Nothing "different", just easier. </flamebait>If you prefer a more stand-alone server, I would recommend MAMP .

0
source

All Articles