Zend Framework and Why It Matters

May 13, 2008 · Filed Under Programming · Comment 

One of the aspects that I believe that has kept PHP from gaining significant ground as a legitimate enterprise language is that it hasn’t had the tools to prove that it is beyond merely a hobbyist’s tool or just merely a language that is good for building prototypes of an application. I don’t think anyone will say that PHP slows down the development process, but a lot of people outside the PHP community (and inside) would say that PHP can make for very sloppy, insecure code.

They would be correct. One can say that about any language but PHP enables just about anyone to sit down and build an application without them really needing to know what they are doing. PHP gives the coder a large amount of power without babysitting them. This strength has also caused a lot of problems as it has let coders get away with a lot of things that have lead to large security holes.

One thing that can help mitigate a lot of bad coding mistakes is to use a good set of tools to help the coder make the correct decisions. While nothing can replace good training in both PHP syntax and coding in general, one of the strongest tools a coder can give themselves is a framework that has taken care of many of the common tasks associated with application building. The Zend Framework, while being a somewhat new kid on the block in terms of frameworks, gives a coder a large amount of usable code to speed up development while making sure that good design decisions are enforced.

Read more

PHP Include Paths By Virtual Host

December 28, 2007 · Filed Under Programming, Servers · 2 Comments 

While splitting apart a website into discreet applications, I moved all the shared code to its own folder. While that isn’t a hard thing to do, what does one do in a development environment where the shared files might be undergoing changes that you don’t want other environments to see?

Set a custom include path!

In each of my Virtual Host sections, I added the following line:

php_value include_path '/path/to/my/include'

With a restart of Apache, each environment now looks to its own custom include folder.

Speed up PHP with APC

May 21, 2007 · Filed Under Servers · Comment 

A downside to any scripted language is that it is recompiled every time that it is run. CPU cycles are wasted compiling both simple and complicated scripts over and over, regardless if the actual output even changes. What can you do to stop this kind of waste? If you are using PHP, there are quite a few caching mechanisms. I spent most of today trying to get a few of them to work with OpenBSD 4.1 with very little success. One that I did get working was APC.

Read more