Posts Tagged ‘zend server’

Develop PHP applications with the new Zend Server CE 5.0 with PHP 5.3

Zend just released Zend Server 5.0 a couple of days ago. As it has been the case for the previous versions, when downloading you can choose to get a version with PHP 5.2 or 5.3.

The Zend Server is available on Linux, Mac OS X and Windows, covering the wide spectrum of  platforms making it an attractive development platform. This is specially important for Windows and Mac users where having a solid PHP installation is not so simple. The Zend Server comes with a complete PHP stack along with the most common extensions included. It also comes with a debugger which interfaces with Zend Studio allowing developers to put breakpoints in their PHP code.

Installation on my Mac with OS X went very smoothly. Everything was installed on /usr/local/zend. After completing the installation this is what I did to “fix” the installation for my needs:

  • edited Apache’s config (/usr/local/zend/apache2/conf/httpd.conf) and added the following line so Apache listens on the standard web port.
    Listen 80
  • Added my virtual hosts to conf/extra/httpd-vhosts.conf. Make sure this file is included in the main httpd.conf file with the following line:
    Include conf/extra/httpd-vhosts.conf
  • edited Mysql’s config (/usr/local/zend/mysql/data/my.cnf) to allow network connections by commenting the line  skip-networking.
  • I restarted Zend server which in turns restarts Apache and Mysql with sudo /usr/local/zend/bin/zendctl.sh restart
  • I did notice that if you want to connect to mysql from PHP using localhost, it fails because it does not find the mysql.sock in /tmp. I fixed this by created a link with this command:
    sudo ln -s /usr/local/zend/mysql/tmp/mysql.sock /tmp/

That’s pretty much it. After a few minutes, I had PHP 5.3 running and my Symfony/Zend Framework projects were up and running. By having the latest version of PHP 5.3, I am now able to play around with the newly released alpha version of Symfony 2.0!

03

03 2010

Enable MySQL query logging in Zend Server CE

Zend Server CE includes an installation of MySQL, which is very handy. Since Zend Server CE is used mostly to setup a quick development environment, it is very useful to view the MySQL query log, where all SQL queries are logged.

To enable the query log, you need to modify the file /usr/local/zend/mysql/bin/mysql.server:

  • Locate the following line:
$bindir/mysqld_safe --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &
  • Modify it by adding ‘-l’ so it looks like:
$bindir/mysqld_safe -l --datadir=$datadir --pid-file=$server_pid_file $other_args >/dev/null 2>&1 &

Then, restart mysql by running:

/usr/local/zend/mysql/bin/mysql.server stop

/usr/local/zend/mysql/bin/mysql.server start

24

08 2009