Setup Local Web Development Environment on Mac

If you are a mac user and web developer like me, chances are you need a local lamp web development environment setup.

There are a few very powerful solutions available that can be setup in just a few clicks. I use and recommend Zend Server CE. It’s free, updated often and has good out-of-the-box configuration. You can download Zend Server CE here.

You can download Zend Server CE with PHP 5.2 or PHP 5.3 depending on your preferences. It also comes with MySQL 5 and phpmyadmin for easy development.

After installing Zend Server CE, add following to the .bash_profile file in your home directory.

This will allow you to use php, mysql and other tools from the command line. You can also use the .bashrc file if you wish instead.

By default the Zend Server CE Admin is located at http://localhost:10081/ZendServer/Login

The Zend Server Help documentation has more information.

You can now use zendctl.sh to control your installation:

Here is a summary of the available commands:

start: Start all Zend Server daemons
start-apache: Start Apache only
start-mysql: Start MySQL only
start-jb: Start Java Bridge only
start-lighttpd: Start lighttpd only

stop: Stop all Zend Server daemons
stop-apache: Stop Apache only
stop-mysql: Stop MySQL only
stop-jb: Stop Java Bridge only
stop-lighttpd: Stop lighttpd only

restart: Restart all Zend Server daemons
restart-apache: Restart Apache only
restart-mysql: Restart MySQL only
restart-jb: Restart Java Bridge only
restart-lighttpd: Restart lighttpd only

setup-jb: Setup Java bridge
version: Print Zend Server version
status: Get Zend Server status

If you do not want to use Zend Server CE, you can install apache/php/mysql manually on mac osx or use macports to install additional packages. You can also use MAMP, which is another popular alternative.

, , , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *