Sunday, July 30, 2006

LAMP Stack Development

Well, I have recently been pretty heavy into PHP development and must say that is quite an change compared to Java/Struts and J2EE type development. One nice thing I have found is taht Eclipse and Zend are working together to make this a smooth process with the PHPIDE. If you are a Java developer and already use Eclipse, you will feel quite at home using the Zend PHPIDE which is an Eclipse 3.2 plugin that works quite nicely even in beta form.

There are pros and cons to using the LAMP (Linux, Apache MySQL, Perl/PHP) or WAMP (Windows, Apache, MySQL, Perl/PHP) stack. I will just refer to this as the LAMP stack from now on in this posting. One benefit is that all the tools are open source. There are very few financial barriers to using these technologies. The primary con I see if that you have to ensure that you are using compatible versions of each of the components in your technology architecture. One solution is just try a VMware appliance, WAMP, or XAMMP packages pre-built for Linux or Windows. The downside to the pre-packages approach is that if you have to deploy and support a LAMP/WAMP stack, you will not have the necessary configuration skills for troubleshooting issues that may occur on your servers. I recommend that if you need to support this stuff, then learn to do it the hard way at least once so you will know the configuration and mechanics of the LAMP stack. The "Install & Configure Apache, PHP, JSP, Ruby on Rails, MySQL, PHPMyAdmin & WordPress on Windows XP/2000" and "Building a LAMP Server" HOWTOs really helped me out with this stuff among other HOWTOs I found. As usual, the HOWTO article was not bullet-proof or 100% accurate. I think I found about a 75% accuracy rate for configuring LAMP. Most issues I have found concern the PHP5 and MySQL5 issues (see this Zend post).

In other words, I discovered that MySQL 5 and PHP 5 have introduced some connectivity issues and incompatibilities with latest Apache HTTP Server. PHP5 doesn't even work with Apache 2.2 in my experience and I confirmed after doing quite a bit of research on the web. From what I have seen, the PHP community is working on supporting Apache 2.2. For MySQL5 and PHP5 you need to be using Apache HTTP Server 2.0. I learned this the hard way. Additionally, I was not aware that MySQL5 breaks quite a few PHP applications due to changes in password encoding and introduction of object-orientation in PHP5. Then there is the PHP mysqli extension that supercededs the mysql extension that is built into PHP. What a frustrating experience that is.

Anyway, what I have learned with all this experimentation with LAMP stack is that it is like all the other open source technology solutions I have been working with in the past few years. It does work with a few caveats. LAMP works as good as your understanding, skills and ability to use the web for research all the tools and components. Paraphrasing this, LAMP works if you are willing to put in the time and have the right mentality and necessary open source skills to solve problems.

No comments: