I've installed Zend Server CE on my Mac to see where it's got to and it's looking quite usable. The installation puts everything into the usr/local/zend directory which is fairly well laid out so that you can find what you are looking for. There's also a a nice admin system at http://localhost:10081 which allows you to restart PHP, view phpinfo(), configure extensions and php.ini. There's also a phpMyAdmin to help administer the bundled MySQL server.
For Mac, this is now one of the better one stop shops for easy PHP & MySQL installation.
Obviously, some things need configuration:
Set up paths
You need access to the command line zendctl.sh and mysql tools:
- Edit ~/.bash_profile and add:
PATH=$PATH:/usr/local/zend/bin:/usr/local/zend/mysql/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib - Close Terminal and restart it so that your change takes effect.
Change to port 80
The Apache in Zend Server is configured for 10088 to avoid conflicting with Apple's Web Sharing I suppose. The choice of using port 80 would have been nice as an installation option though.
To use port 80 is easy enough:
- Stop Apache: sudo zendctl.sh stop-apache
- Edit /usr/local/zend/apache2/conf/httpd.conf and replace Listen 10088 with Listen 80
- Edit /usr/local/zend/apache2/bin/apachectl and change STATUSURL="http://localhost:10088/server-status" to STATUSURL="http://localhost:80/server-status"
- If you are using vhosts, then edit /usr/local/zend/apaches/conf/httpd.conf and replace all instances 10088 with 80
- Restart Apache:sudo zendctl.sh start-apache
Installing PHPUnit
Update PEAR first:
sudo pear channel-update pear.php.net
sudo pear upgrade-all
Install PHPUnit:
sudo pear channel-discover pear.phpunit.de
sudo pear install phpunit/PHPUnit
Installing Xdebug
- Install Xcode so you have a compiler!
- Stop Apache: sudo zendctl.sh stop-apache
- Go to http://localhost:10081/ and pick the Server Setup tab. Turn off the Zend Debugger and Zend Data Cache and restart PHP
- sudo pecl install xdebug
- Edit /usr/local/zend/etc/php.ini and add above the [zend] section near the bottom:
zend_extension="/usr/local/zend/lib/php_extensions/xdebug.so" [xdebug] xdebug.remote_enable=1 xdebug.remote_host="localhost" xdebug.remote_port=9000 xdebug.show_local_vars=On xdebug.var_display_max_data=10000 xdebug.var_display_max_depth=20
(you should set up your xdebug settings as you require!)
- Restart Apache:sudo zendctl.sh start-apache
- The Server Setup->Extensions section of the admin interface should now show xdebug.
All in all, it's remarkably easy to set up Zend Server using PEAR and PECL is which how it should be.
The only other gotcha I noticed is that my.cnf is in /usr/local/zend/mysql/data whereas I would have thought that /usr/local/zend/etc would have been more logical.


