Installing Zend Server CE on Ubuntu
Just as I was finishing my review of the beta version of Zend Server CE, Zend proudly announced the release of Zend Server and Zend Server Community Edition (CE). So I had to start all over again with a fresh installation of Zend Server CE 4.0.1. I was pleased to see that they fixed some of the quirks and bugs I had encountered in the beta version, but oddly enough they introduced some new ones too.
Zend has made quite a lot of noise about their latest products, namely Zend Server and Zend Server CE (Community Edition) and I felt tempted to try it out for myself.
According to Zend, the Zend Server Community Edition (CE) is a free Web Application Server that is simple to install and easy to use. Well, you are about to find out, if you continue reading. It is intended as a community-supported product via the Zend support forums, and updates will be made available periodically. Still according to Zend, the Zend Server CE should be ideal for developing and running non-critical PHP applications. Replace free with commercial, non-critical with business-critical and add some extra features in the mix and you have the Zend Server. Since I do not need a commercial webserver I decided to try out the community edition.
Ubuntu server
At home I usually tinker with virtual Ubuntu servers, so I installed a basic virtual Ubuntu server (8.04 LTS) with OpenSSH server as the only extra software package, no LAMP. I already posted an article on how to install a virtual Ubuntu server on Mac OS X using VirtualBox, so I will not repeat it here. I christened this server zsce and assigned the static IP-address 192.168.1.83 to it. I didn’t bother installing the linux guest additions for VirtualBox.
Zend Server CE doesn’t install a DBMS and the manual doesn’t mention it either, but I thought it made sense to install MySQL before attempting to install Zend Server CE.
sudo aptitude install mysql-server mysql-client
You will be prompted to provide a root password for MySQL.
And now …
Installing Zend Server CE
I used the DEB installation method for installing Zend Server CE using aptitude. Installing on a Ubuntu server means using the command line only.
First you will have to add a repository to be able to download the Zend Server CE
sudo vi /etc/apt/sources.list
Add the following lines to the file:
# Zend Server CE deb http://repos.zend.com/deb/ce ce non-free
Add Zend’s repository public key. If you did not use the sudo -s command earlier, like mentioned in the manual, you will get the following error:
johan@zsce:~$ sudo wget http://repos.zend.com/deb/zend.key -O- |apt-key add - --10:31:23-- http://repos.zend.com/deb/zend.key => `-' Resolving repos.zend.com... 93.188.130.102 Connecting to repos.zend.com|93.188.130.102|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1,673 (1.6K) [text/plain] 100%[========================================================>] 1,673 --.--K/s 10:31:24 (441.22 KB/s) - `-' saved [1673/1673] gpg: no writable keyring found: eof gpg: error reading `-': general error gpg: import from `-' failed: general error
Lesson learned: follow the manual to the letter or place the sudo command before the apt-key command.
johan@zsce:~$ wget http://repos.zend.com/deb/zend.key -O- | sudo apt-key add - --10:32:41-- http://repos.zend.com/deb/zend.key => `-' Resolving repos.zend.com... 93.188.130.102 Connecting to repos.zend.com|93.188.130.102|:80... connected. HTTP request sent, awaiting response... 200 OK Length: 1,673 (1.6K) [text/plain] 100%[========================================================>] 1,673 --.--K/s 10:32:41 (104.95 KB/s) - `-' saved [1673/1673]
To follow the manual more closely I now ran the sudo -s command, which makes me root.
johan@zsce:~$ sudo -s [sudo] password for johan: root@zsce:~#
Update the package repository info.
aptitude update
Install Zend Server CE. I copied most of the installation messages so you can see which packages are installed with Zend Server CE.
root@zsce:~# aptitude install zend-ce Reading package lists... Done Building dependency tree ... The following NEW packages will be installed: apache2-mpm-prefork apache2-utils apache2.2-common libaio1 libapache2-mod-php5-zend-ce libapr1 libaprutil1 libframework1-zend-ce libicu36 libmcrypt4 libmhash2 liboci-zend libpng12-0 libpng3 libpq4 libpq5 libsqlite0 lighttpd-zend-ce openssl php-bcmath-zend-ce php-bz2-zend-ce php-calendar-zend-ce php-ctype-zend-ce php-curl-zend-ce php-data-cache-zend-ce php-debugger-zend-ce php-dev-zend-ce php-exif-zend-ce php-fcgi-zend-ce php-ftp-zend-ce php-gd-zend-ce php-gettext-zend-ce php-imap-zend-ce php-intl-zend-ce php-json-zend-ce php-ldap-zend-ce php-mcrypt-zend-ce php-mhash-zend-ce php-mime-magic-zend-ce php-mysql-zend-ce php-mysqli-zend-ce php-oci8-zend-ce php-optimizer-plus-zend-ce php-pdo-mysql-zend-ce php-pdo-oci-zend-ce php-pdo-pgsql-zend-ce php-pgsql-zend-ce php-posix-zend-ce php-soap-zend-ce php-sockets-zend-ce php-sqlite-zend-ce php-tidy-zend-ce php-tokenizer-zend-ce php-xmlreader-zend-ce php-xmlwriter-zend-ce php-xsl-zend-ce php-zem-zend-ce php-zendutils-zend-ce php-zip-zend-ce php5-common-extensions-zend-ce sqlite zend-base-ce zend-ce zend-ce-doc zend-extensions-ce zend-framework-ce zend-gui-ce 0 packages upgraded, 67 newly installed, 0 to remove and 10 not upgraded. Need to get 48.5MB of archives. After unpacking 179MB will be used. Do you want to continue? [Y/n/?] Y ...
This can take a while depending on your connection.
... Setting up sqlite (2.8.17-4build1) ... Setting up zend-extensions-ce (4.0.0-1+b60) ... dpkg: dependency problems prevent configuration of zend-gui-ce: zend-gui-ce depends on lighttpd-zend-ce; however: Package lighttpd-zend-ce is not configured yet. zend-gui-ce depends on php-fcgi-zend-ce; however: Package php-fcgi-zend-ce is not configured yet. dpkg: error processing zend-gui-ce (--configure): dependency problems - leaving unconfigured Setting up zend-framework-ce (1.7.8+b34) ... Setting up zend-ce-doc (4.0.10+b20) ... dpkg: dependency problems prevent configuration of zend-ce: zend-ce depends on zend-gui-ce; however: Package zend-gui-ce is not configured yet. dpkg: error processing zend-ce (--configure): dependency problems - leaving unconfigured Processing triggers for libc6 ... ldconfig deferred processing now taking place Errors were encountered while processing: lighttpd-zend-ce php-fcgi-zend-ce zend-gui-ce zend-ce E: Sub-process /usr/bin/dpkg returned an error code (1) A package failed to install. Trying to recover: Setting up lighttpd-zend-ce (1.4.18-1+b56) ... Setting up php-fcgi-zend-ce (5.2.9+b36) ... Setting up zend-gui-ce (4.0.16+b150) ... Site zendserver_gui.conf installed; run /etc/init.d/apache2 reload to enable. * Reloading web server config apache2 Setting up zend-ce (4.0.0-1+b60) ... * Stopping web server apache2 apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName httpd (no pid file) not running ...done. Starting ZendServer 4.0.0 .. apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1 for ServerName spawn-fcgi.c.206: child spawned successfully: PID: 7700 Starting ZendServer GUI [Lighttpd] [OK] [08.04.2009 10:44:59 SYSTEM] watchdog for lighttpd is running. [08.04.2009 10:44:59 SYSTEM] lighttpd is running. ZendServer started...
This is a bug they fixed. In the beta version the installation stopped after ‘E: Sub-process /usr/bin/dpkg returned an error code (1)’. I then had to run the installation command again to get to the message ‘ZendServer started…’.
If you want to get rid of the ‘Could not reliably determine the server’s fully qualified domain name… ‘, just add a servername to the Apache configuration file.
vi /etc/apache2/apache2.conf
ServerName zsce
Restart all Zend Server Community Edition daemons.
root@zsce:~# /usr/local/zend/bin/zendctl.sh restart Stopping ZendServer GUI [Lighttpd] [OK] spawn-fcgi.c.206: child spawned successfully: PID: 8359 Starting ZendServer GUI [Lighttpd] [OK]
Check the Zend Server Community Edition status
root@zsce:~# /usr/local/zend/bin/zendctl.sh status [08.04.2009 10:04:54 SYSTEM] Apache is running. [08.04.2009 10:48:54 SYSTEM] watchdog for lighttpd is running. [08.04.2009 10:48:54 SYSTEM] lighttpd is running.
Hurray!
Browsing, using Firefox, to https://192.168.1.83:10082 I got ‘Secure Connection Failed’ error; ’192.168.1.83:10082 uses an invalid security certificate …’. So confirm the exception and you will get a prompt to provide a password for Zend Server CE.
Post-installation steps
Adding the <install_path>/bin directory to the $PATH environment variable for all users.
Finding the <install_path> directory for your Zend Server (linux). I already know that the zendctl.sh script is located in that directory, so all I have to do is to find it.
root@zsce:~# updatedb root@zsce:~# locate zendctl /usr/local/zend/bin/zendctl.sh
By the way, the location is also mentioned in the manual. Just showing off.
root@zsce:~# vi /etc/profile
and add the following lines to the end of the file:
PATH=$PATH:/usr/local/zend/bin LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib
In order for the changes to take effect, run the following command:
root@zsce:~# source /etc/profile
I decided to install the extra extensions.
root@zsce:~# aptitude install php5-extra-extensions-zend-ce Reading package lists... Done Building dependency tree ... The following NEW packages will be installed: libgif4 libgmp3c2 libltdl3 libming0 libmssql-zend odbcinst1debian1 php-fileinfo-zend-ce php-gmp-zend-ce php-imagick-zend-ce php-mbstring-zend-ce php-memcache-zend-ce php-ming-zend-ce php-mssql-zend-ce php-odbc-zend-ce php-pcntl-zend-ce php-shmop-zend-ce php-sysvmsg-zend-ce php-sysvsem-zend-ce php-sysvshm-zend-ce php-wddx-zend-ce php-xmlrpc-zend-ce php5-extra-extensions-zend-ce php5-unix-extensions-zend-ce unixodbc 0 packages upgraded, 24 newly installed, 0 to remove and 10 not upgraded. Need to get 4311kB of archives. After unpacking 10.4MB will be used. Do you want to continue? [Y/n/?] Y
and also phpMyAdmin.
root@zsce:~# aptitude install phpmyadmin-zend-ce Reading package lists... Done Building dependency tree ... Setting up phpmyadmin (4:2.11.3-1ubuntu1.1) ... Lighttpd not installed, skipping invoke-rc.d: unknown initscript, /etc/init.d/lighttpd not found. Setting up phpmyadmin-zend-ce (4.0.0-1+b17) ... ...
I selected lighttpd as webserver for phpMyAdmin when prompted, this isn’t mentioned in the manual, but it produced a message stating that lighttpd is not installed. I ignored it and phpMyAdmin seems to be correctly installed and working. When you have ServerSpy installed in your Firefox browser you will notice that phpMyAdmin uses lighttpd as webserver. Strange, but it works, just keep going.
When I tried to access phpMyAdmin via my browser (still using my MacBook) I got the following message:
“For security reasons, the link to the phpMyAdmin interface from Zend Server is locked for remote access and is only accessible from localhost. “
Great, I am running Zend Server CE on a command line only linux server and must access phpMyAdmin from the localhost. Zend Server CE is also supposed to be for development environments, so where’s the harm in accessing phpMyAdmin from another computer? Despite being my first encounter with lighttpd it took me only a couple of minutes to figure out how to fix this, without RTFM. I added the IP-address of my home network (192.168.1) to the lighttpd configuration file.
vi /usr/local/zend/gui/lighttpd/etc/lighttpd.conf
...
$HTTP["remoteip"] !~ "127.0.0.1" {
$HTTP["url"] =~ "^/phpmyadmin/" {
url.access-deny = ( "192.168.1" )
server.errorfile-prefix = "//usr/local/zend/gui/lighttpd/share/lighttpd-custom-errors/errorcode-"
}
}
...
Restart all Zend Server Community Edition daemons.
root@zsce:~# /usr/local/zend/bin/zendctl.sh restart Stopping ZendServer GUI [Lighttpd] [OK] spawn-fcgi.c.206: child spawned successfully: PID: 8359 Starting ZendServer GUI [Lighttpd] [OK]
Don’t ask me to explain the change to the lighttpd config file, my first attempt to fix it worked. Hurray!
Now we get to the point were they included some new bugs.
I wanted to install the Dojo toolkit and the Zend Framework extras. But compared to the beta version the manual now contains some typos which will prevent you from installing them.
From the manual for version 4.0.1:
aptitude install framework-zend-dojo-ce
resulted in
Couldn't find any package whose name or description matched "framework-zend-dojo-ce"
and
aptitude install framework-zend-extras-ce
resulted in
Couldn't find any package whose name or description matched "framework-zend-extras-ce"
A quick search in the manual for the beta version revealed that the correct way to install the packages is:
aptitude install zend-framework-dojo-ce
and
aptitude install zend-framework-extras-ce
This way the packages installed without errors. Since I have never used the Dojo toolkit and the Zend framework I didn’t test them.
I did not install any other packages, so I do not know if there are more typos.
Tests
This is just a review about the installation of the community edition of the Zend Server. No tests, no benchmarks, no security audit, … Well, as it was installed separately, I did test the database connection to MySQL using the following 3 database extensions: MySQL, MySQLi and PDO.
I created a database (testdb), with 1 table (names) containing 2 fields (id and name), inserted some records using phpMyAdmin and tested the connection to the database and retrieval of the data using PHP-scripts.
The first 2, MySQL and MySQLi, worked flawlessly, but this was not the case for PDO. The following error was displayed in the browser, when testing PDO on Zend Server CE:
Error: SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2)
The solution for this problem (via Google) was to include socket information in the DSN (Database Source Name) as you can see in the script below. I never encountered this problem when using the default LAMP installation on Ubuntu or CentOS.
<?php
try {
$dbc = new PDO(
'mysql:host=localhost;dbname=testdb;unix_socket=/var/run/mysqld/mysqld.sock',
'testusr', 'testpwd');
$sql = 'SELECT * FROM names';
foreach ($dbc->query($sql) as $row) {
echo $row['id'] . '. ' . $row['name'] . "<br />\n";
}
} catch (PDOException $e) {
echo "Error: " . $e->getMessage() . "<br />";
}
$dbc = null;
?>
Test PECL installation:
root@zsce:~# pecl list-all All packages [Channel pecl.php.net]: ==================================== Package Latest Local pecl/APC 3.1.2 Alternative PHP Cache pecl/memcache 2.2.5 memcached extension pecl/hidef 0.1.1 Constants for real pecl/memcached 0.1.5 PHP extension for interfacing with memcached via libmemcached library pecl/spidermonkey 0.1.2 JavaScript engine for PHP pecl/selinux 0.2.1 SELinux binding for PHP script language pecl/bloomy 0.1.0 Extension implementing a Bloom filter
OK
Test documentation. The following chapters on the locally installed help for the Dashboard (https://192.168.1.83:10082/ZendServer/help/zend_server.htm#dashboard.htm) returned not found errors (404).
- Administration Interface/Administration/Passwords
- Tasks/Working with Zend Server
Review
Bugs / quirks / annoyances / missing / typos / remarks:
- Missing: MySQL
- Missing: PHP CLI. My mistake, it is present.
- Typos (?): names of the packages Dojo and extras for Zend Framework are spelled wrong in the manual
- Documentation: when to install your DBMS, what webserver to choose when installing phpMyAdmin, how to allow access to phpMyAdmin from outside localhost, the relationship between lighttpd and Apache, …
- Bug: PDO, doesn’t work without including socket info in the DSN
- Installation takes more time and effort than a default Ubuntu or Centos LAMP installation.
- The installation of phpMyAdmin reported lighttpd not installed.
- Bug: some broken links in the locally installed help
I can understand Zend not including MySQL in the installation, because not everyone uses MySQL and if they did include it, people would start complaining why PostgreSQL isn’t included. So, it’s no big deal. It would be a good idea though to include in the installation manual when you are supposed to install your DBMS. Most likely this will be before installing Zend Server, but it wouldn’t hurt mentioning this.
It isn’t that difficult to install Zend Server CE, but it takes more time and work than a default LAMP installation on Ubuntu.
Documentation is still a bit lacking: when to install your database (before seems logical to me), installation of phpMyAdmin (which webserver to choose, how to allow access from another computer), more information on the relationship between lighttpd and Apache … I am not asking for a complete manual on lighttpd and Apache here, it’s just the first time I am confronted with lighttpd (among other stuff) … or is all that supposed to be common knowledge.
Actually, I find it impressive. It’s quite an achievement to offer a product like this and making it free for home/development/non-critical use. No less than 5 installation methods: 1 for Microsoft Windows, 1 for Mac OS X and 3 for Linux (tarball, RPM and DEB). The list of software and packages is extensive, but I might not be the right person to appreciate all of this. I’ve never used a debugger, caching, … and I don’t know why they install 2 webservers (lighttpd and Apache) instead of just one. This is why I stick to reviewing the installation procedure. Let’s be honest; the list of bugs, remarks, … will not take a long time fixing.
Why would you use Zend Server CE ?
Speaking for myself, from a professional and personal perspective, I see no use for Zend Server CE in the near future. This may sound quite harsh, but let me explain.
At work we have a mixed server environment, Windows and Linux (CentOS, Scientific Linux) servers. I do not see us replacing the current webserver setups with Zend Server (CE). Although I do see that a mixed server environment might be the ideal place to use Zend Server; resulting in identical setups for your Windows and Linux webservers, which would make it possible to move sites easily. Especially if you start from a clean slate or want to restart with a clean slate. But this will require a lot of work and I don’t see it happen any time soon. It’s also no use to develop on Zend Server CE when you do not use Zend Server in your production environment.
I am also not impressed with the argument that Zend Server uses a very recent version of PHP (5.2.9) compared to Ubuntu 8.04 LTS (5.2.4) and CentOS / RHEL / SL (5.1.6). You choose an environment and you stick with it for a while and since security updates and bug fixes are backported I do not see a problem with this approach. I do admit that RHEL’s approach feels a bit like the other extreme compared to Zend Server.
It’s very unlikely that shared hosting sites will move en masse to Zend Server in the near future. So when I develop my personal site at home on a Zend Server CE installation and then upload my site to my webhost, there is a risk that there will be errors due to different PHP versions or different installed components, modules and packages. This is asking for trouble; you should always keep your development environment identical (or as identical as possible) to your production environment. The same goes if you work as an independent contractor. Of course, if Zend Server gains a lot of momentum this situation might change in the years to come, but I feel no need to be an early adopter.
I do not feel like I have wasted my time installing Zend Server CE even as I have no intention of using it in the near future. It made me realize that there are some areas where my knowledge is lacking: debuggers, caching, Zend Framework, lighttpd, … So my list of interesting things to study just got a bit longer.
| There is no place like 127.0.0.1 |
Hello Johan,
Thanks for the very extensive review [at least installation and configuration wise]
You’ve raised a lot of points so I hope not to drop anything along the way..
Documentation issues: all will be fixed for the next release and I appreciate the time you took to review and state them.
MySQL bundling: we do not bundle MySQL for two reasons:
0. As you stated, not all users will be interested in having a MySQL server on their machine, some work with a remote one and we saw no point in forcing it on anyone
1. It is so easy to install it from the distro repositories and every self respecting distro includes it.
About PDO_MYSQL not working the same way as MySQL and MySQLi, the root cause for this is that the MySQL and MySQLi PHP extensions both read the directive:
mysql.default_socket and mysqli.default_socket accordingly, while PDO_MYSQL does not have such a directive in the 5_2 branch, it does exist for 5_3 so the issue will be resolved once it is declared stable.
PHP CLI: it does exist and is installed by default, it is placed under: /usr/local/zend/bin/php, the PECL script actually utilizes it, you cannot use PECL w/o PHP CLI.
I can think of several reasons for preferring ZendServer CE over the PHP packages from the distribution:
0. The Zend extensions supplied by ZendServer:
- Zend Optimizer+ for op code caching. While APC is also available, some users reported better results with our extension, for more information see: http://2bits.com/articles/benchmarking-zend-server-community-edition-drupal.html
And this is not to say APC is not a good extension, because it is. Still, depending on your perspective, Optimizer+ does have advantages.
1. Zend Debugger. This is almost a must in the event you’re using Zend Studio but I can certainly respect the fact not all users do.
2. Zend Data cache which enables partial caching of content to shared memory or disk.
There’s also the web UI admin interface, I didn’t see any mention of it in your post but many users find it provides much added value for managing your PHP environment.
About phpMyAdmin being blocked to anything but localhost by default, this is done for security reasons but it definitely should be documented and so it shall be.
Lastly, the UI has its own dedicated web server [Lighttpd] running PHP FCGI, this is done for two reasons:
0. So that, in the event the PHP module loaded by Apache misbehaves in some way, the user will be able to troubleshoot it via the admin UI
1. In order to ensure the needs of the admin UI do not force the user to make compromises in his PHP ENV.
Again, thanks a lot for reviewing the product, should you have more questions, feel free to drop me a line at jess zend com or visit the forums at: http://forums.zend.com.
Thanks for the review, I have also (just) installed and am pretty impressed. I noticed the same bugs as you pointed out. So far this is the only real review I could find on Zend Studio anywhere and I have been searching all day. You see I installed it to compliment my installation of Zend Studio thinking it would help get the debugger working properly. I got it working now, but not sure its because of the new Zend Server install.
Overall I am pretty impressed, such simple things like the logging features (php and server errors, server access logs) all available in one place, sweet. The whole inteface Zend is using looks pretty sharp and will really simplify alot of admin tasks. It has already proved a great way to configure all those tedious settings in PHP, that would otherwise be a pain in the butt to do, you know from within a text editor.
But besides the things I mentioned above I feel that it has alot of hidden value, just cannot figure out how to unlock it. It would be great if somebody posted some information, somewhere on how to integrate it into the Zend development workflow, especially using Zend Studio, and its dubbuger. Also, I see you mentioned that:
“At work we have a mixed server environment, Windows and Linux (CentOS, Scientific Linux) servers. I do not see us replacing the current web server setups with Zend Server (CE). Although I do see that a mixed server environment might be the ideal place to use Zend Server; resulting in identical setups for your Windows and Linux webservers, which would make it possible to move sites easily. Especially if you start from a clean slate or want to restart with a clean slate. But this will require a lot of work and I don’t see it happen any time soon. It’s also no use to develop on Zend Server CE when you do not use Zend Server in your production environment.”
I am willing to put in the work to restart from a clean slate, but what exactly would that require? The issues I am having now is I use Ubuntu Intrepid with the usual LAMP stack, for development as well as Vista (for its Adobe Master Suite install, actually like to put that on a MAC shortly). The production server is running CentOS. So now we are talking about 4 different machines running 4 different OS’s, as you can see it takes as much time to write the application as to keep it running smoothly on all machines. The Apache server settings, in particular the VHOST’s, include paths and such all tend to be an issue keeping identical between machines. Could the Zend Server potentially resolve the issue if I were willing to put in the initial work to ‘restart’ with a clean slate??? Please let me know if you have any ideas, you got the email, thanks…
Correction to above post I made:
“So far this is the only real review I could find on Zend STUDIO anywhere and I have been searching all day.”
should say:
“So far this is the only real review I could find on Zend SERVER anywhere and I have been searching all day.”
@Jess Portnoy/bin directory to the $PATH environment variable. I also didn’t mention the web admin interface and the extra goodies Zend Server offers versus default LAMP installations, but my reasons for not using it remain valid. If you do not intend to install Zend Server on your production machines (company) or your shared webhost (personal site) doesn’t offer it, it’s no use developing your site using Zend Server CE.
Thanks for your comment and clarifying the reason for having both lighttpd and apache installed. I stand correct, PHP CLI is indeed included in Zend Server CE, I guess I tested it before adding the
@Dustin
Using virtual machines it would be easier, but I guess you will have to start moving the sites of one server to the others, maybe reinstall or at least remove the webserver software, install Zend Server (CE), move the sites back one by one, modify/hack/tweak until they work and then start with the next server. Or if you can install a virtual machine identical to your production server (or a desktop pc or install CentOS on a dual boot pc), you can try it out like that first.
Keep in mind that I only tested the installation and post-installation of Zend Server CE. I haven’t developed/installed/modified/moved any sites on/for Zend Server and will not do so in the near future.
Hello Johan,
Thanks for this review.
I just notice that with PDO if you replace host=localhost by host=127.0.0.1 it work without the need of unix_socket=…
But I haven’t found why yet… Will it is working OK with the classic LAMP stack. So the explanation provide by Jess looks strange to me.
@Laurent
Hello Laurent,
It works out of the box with LAMP because LAMP complies its own MySQL and so, sets the socket path to the real target location during the compilation process. However, ZendServer utilizes the MySQL package as it exists in the distributions repositories and hence, does not have that liberty.
On MAC, we do bring our built in MySQL and the issue will indeed not exist there in the next release.
I find your comment on the 127.0.0.1 versus localhost to be interesting, can it be that you commented out the \skip-networking\ option and are hence connecting to MySQL using networking connectivity and not the local UNIX socket? This will explain it.
Hi,
Thanks for your review. I experienced some of the same issues you mentioned (the phpmyadmin/lighttpd issue is what brought me here).
In reading you review I had one question about something you said.
“If you do not intend to install Zend Server on your production machines (company) or your shared webhost (personal site) doesn’t offer it, it’s no use developing your site using Zend Server CE.”
It’s not clear to me how or if this is entirely true. It would seem that there would still be a benefit had from utilizing ZS on a development environment regardless of whether the production server had it installed. It’s unlikely (for me at least) that a debugger would be or need to be installed on a production environment. The optimizer and cache, sure, but those can be had in other ways. I’m mostly interested in the debugging and optimization aspects on dev. So what remains a question for me is, can you develop ZS and deploy without it? And if so, what are the potential issues surrounding deployment in this scenario?
@Hing Hoo Bird
Of course you can develop using ZS and deploy without it, but I wouldn’t recommend it. It can save you a lot of debugging and trouble when you keep your development, testing and production environment identical. The reasons for this are:
- same version of PHP
- same installed libraries and modules
- same location (and version) of frameworks, in this case Zend Framework
I am not saying you will experience problems, but by having a different development, testing and production environment you create potential problems. It is my opinion this should be avoided.
@johan
I see…and that makes sense. Though I’m wondering if anyone out there has had any success with it. Namely, is there anyone out there who has experience developing in a development environment running Zend Server, and deploying to a production server that doesn’t have Zend Server installed?
Also, a note to the original blog author and others that had issues with selecting the wrong web server during the Zend phpMyAdmin: \Please choose the web server that should be automatically configured to run phpMyAdmin. Web server to reconfigure automatically: apache2/lighttpd.\
You can reconfigure phpMyAdmin with the following command: dpkg-reconfigure phpmyadmin. lighttpd may be the more sensible choice.
@Hing Hoo Bird
I use Zend Server CE with Eclipse on Ubuntu to develop and debug locally then move the code to my production testing environment on CentOS for user testing. I’m not sure I would want to even attempt to use Zend Server in production at this point. Especially not in a HA cluster.
You are correct that you need to make sure development, testing and production are running similar software with a similar configuration. I would argue that only testing and production need to be identical. In fact, I would also argue that making development and testing run slightly different versions makes you think more carefully about how you write and use certain code.
For example, we made a lot of use of the PHP imap client which uses the UW imap client. We had a lot of random problems with it that we didn’t particularly understand. Then we started noticing that the same code did different things on development versus testing. So I investigated the UW imap client library problem and anyone who looks closely at the code can tell its complete garbage. We probably would have continued trying to use PHP imap had we not observed the discrepency and investigated further. Instead we rewrote all IMAP code to use Zend_Mail which is implemented entirely in PHP. Its 100% rock solid in comparison.
Man, wisely fantastic! I’ve just installed Zend CE and encountered that error, but after put in my Zend DB Factories the correct socket introduced for you, magicly worked! Thx very much!
I received the same error you did when accessing the phpMyAdmin page. However, I think the way you resolved your access problem may not be the safest configuration.
I changed my lighttpd.conf file as follows:
$HTTP["remoteip"] !~ “127.0.0.1|<remote-ip>” {
$HTTP["url"] =~ “^/phpmyadmin/” {
url.access-deny = ( “” )
server.errorfile-prefix = “//usr/local/zend/gui/lighttpd/share/lighttpd-custom-errors/errorcode-”
}
}
This basically configures two IPs, one local and one remote, to have access to the /phpmyadmin page. Everything else will be blocked.
@Kevin Hinners
Hi Kevin, thanks for your comment. The configuration I described is based on the fact that I cannot use phpmyadmin on the webserver itself, because it is an Ubuntu server without window manager, and that my home network uses DHCP, so the IP addresses of my desktop pc and macbook are variable. That is why I specified a range or subnet. Your solution mentions 127.0.0.1, so I assume you use a linux server with window manager or a windows server, and a fixed IP address, so I assume you either work alone and that your client computer has a fixed IP address or that you access phpmyadmin from another (via VPN or VNC) server. Specifying a subnet, like I did, means that your team members or colleagues can access phpmyadmin too, unless you work alone.
Cheers,
Johan
@Adriano Alves
Hi Adriano,
I am glad you found my review helpful.
Johan
Everything went perfect.
One thing: How to activate mod_rewrite?
Is this done via the gui or do I have to go into httpd.conf
Please advise.
Thanks.
Ok, so answer myself.. this is how it works.
Thanks
1) Change in /etc/apache2/sites-available/default
“AllowOverride None” to “AllowOverride all”
2) apache2ctl stop
3) apache2ctl start
How above “default” file should look like after the change:
ServerAdmin webmaster@localhost
DocumentRoot /var/www
Options FollowSymLinks
AllowOverride all
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
allow from all
And to deploy dodoapp with the linking problem in the Mysql use this for configuration.ini
resources.db.adapter = “PDO_MYSQL”
resources.db.params.host = “localhost”
resources.db.params.unix_socket = “/var/run/mysqld/mysqld.sock”
resources.db.params.username = “root”
resources.db.params.password = “asdasdf”
resources.db.params.dbname = “dodo”
where unix_socket is the important addition..
How to update Zend Server CE to the most recent version supporting PHP 5.3?
Thanks.
@tronics
You can either (re)install Zend Server CE with PHP 5.3 or wait till Zend updates and unifies the repositories (http://www.zend.com/en/products/server-ce/downloads?hpb=server_CE_Download).
Your install docs are more accurate than zend’s website. I wouldn’t have completed it without the help of your post. Thanks for the info!
@clint
That is what blogs are for; helping people.
UPDATE (zend changed something):
Repository for 5.3 should be:
deb http://repos.zend.com/zend-server/deb server non-free
And Zend Server Install:
aptitude install zend-server-ce-php-5.3
Regards,
tronics
zend-server-framework-dojo
zend-server-framework-extras
phpmyadmin-zend-server
have new names too
@tronics
It’s good that they update their products and remove the bugs, but as I have currently no use for Zend Server, I don’t follow the news. I did it for the challenge for testing out their product and writing a software review.
@johan
That is ok. I just keep this uptodate..
@johan hmm I’m stuck. There is no “APache eXtenSion tool” apxs in zend server.
I need it to compile mod_wsgi http://code.google.com/p/modwsgi/wiki/QuickInstallationGuide to get Python to run.
Do you have any idea what to do. Install an additional apache is not so cool, what do you think?
About the error message: “SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) ”
A simple solution that worked for me was to add the following directive
mysql.default_socket = /var/run/mysqld/mysqld.sock
to “/usr/local/zend/etc/ext.d/mysql.ini” file.
another way to deal with the
“SQLSTATE[HY000] [2002] Can’t connect to local MySQL server through socket ‘/tmp/mysql.sock’ (2) ”
issue
is to do a
sudo ln -s /usr/local/zend/mysql/tmp/mysql.sock /tmp/mysql.sock
however, i would like to point out…
that i just this week, got my Zend Server CE working with my Eclipse on my 27 inch Imac…
and i NEED to be able to trace debug!
it’s just the way i operate
so…..
i don’t know
all i know is that Zend made it *so* easy for me to setup…
so i won’t be wasting anytime HIGHLY recommending Zend to my future clients!
I’ve never seen a work environment (Zend, Php 5.3, Mac Leopard OS X 10.6, MySQL, Apache) work so well, so quickly, so intuitively….
i’ve been doing C++ and Java for almost two decades…
and from where I am sitting
PHP is the way to go!
- Perry