Friday, July 25, 2008

PHP 5 Certification

I recently decided to pursue a PHP 5 Certification. I purchased the Zend PHP 5 Certification Bundle, which includes the study guide (hardcopy and downloadable PDF), 10 online practice exams, and an exam voucher. I just finished reading over the 250 page study guide. It covers a variety of PHP concepts:
  • PHP Basics
  • Functions
  • Arrays
  • Strings and Patterns (including regular expressions)
  • Web Programming
  • Object-oriented Programming
  • Object-oriented Design
  • Database Programming
  • XML and Web Services
  • Security
  • Streams and Network Programming
  • Differences Between PHP 4 and 5
After reading the guide, I took my first practice exam and scored Excellent overall. Scores are displayed as Fail, Pass, or Excellent. The website says that the practice exams are more difficult than the real exam. If you have a good working knowledge of PHP, the exam should not be too difficult. Here are some topics that you should be familiar with:
  • PHP Operators (instanceof, ===, @, etc)
  • Parsing XML documents and using SOAP services
  • Regular expressions
  • Commonly used string functions (php.net/strings)
  • Using prepared SQL statements
  • Basic design patterns
  • Classes and object oriented programming
  • Array functions (php.net/ref.array)
  • Standard PHP Library (php.net/book.spl)
    • Know Array interfaces and Autoload

In addition to these, you should know how to write secure PHP code. If you are not aware of how to do this, please stop writing PHP code. You can download the Security chapter of the PHP 5 Study Guide for free from http://www.zceguide.com. I recommend purchasing the study guide to help study for the exam. The exam expects that you use PHP often enough to recall basic functions, but it does not expect you to memorize the entire PHP manual. You should know some of the differences between PHP 4 and PHP 5. This includes different class access levels (public, private, protected and final), interfaces, and references. Overall, I feel that the certification is a good way to help determine whether or not an employee has the skills necessary to develop solid PHP applications. You can read more about it on the Zend certification website.

Friday, July 18, 2008

Coding on two computers? Get Synergy

Synergy is an open source program that enables you to use a single mouse and keyboard across multiple computers acting like a virtual KVM. This is very helpful if you have two (or more) computers next to each other. You can copy / paste between the different computers, which is very helpful for coding. One of my favorite features is that Synergy can be run on Windows, Mac, and linux operating systems. I have a computer running Slackware linux next to my Windows Server 2003 computer and Synergy makes software development much easier since I am able to use both computers as if they were one.

I can quickly test web applications on multiple web browsers with multiple operating systems. If you use Network Attached Storage or simply configure a network share between the computers, it is similar to running a dual monitor setup. If you are using dual monitors, check out my blog post about coding with dual monitors. You could even setup an audio server to integrate the computers more closely. Pretty much the only thing you cannot do is drag windows from one computer to another.

Synergy labels your different computers as screens. You need to set Screen1 to be left of Screen2 and Screen2 to be right of Screen1. If you do not do both of these, your cursor could be stuck on one monitor. You can set it so that moving your cursor to the upper right corner does not cause it to switch to the other monitor. If you want to, you could even place a screen on top of another screen. Your keyboard types on whichever monitor that your cursor is currently on. You can configure shortcut keys to switch focus or lock your cursor onto a certain screen. (useful if you play video games) Check it out at http://synergy2.sourceforge.net.

Friday, July 11, 2008

WampServer for Web Development

WampServer 2 is an open source package that includes Apache, PHP, and MySQL all in a simple, easy to setup installer for Microsoft Windows. It is ideal for web development on a Windows platform. The term WAMP is an acronym describing a common software configuration running Windows with Apache, PHP, and MySQL. You can get your Apache server up and running with PHP and MySQL within minutes. This can take hours to download, install and configure these applications individually, especially if you do not have experience with them.

WampServer installs a task tray icons that allows you to easily manage your server. You can enable and disable PHP extensions with the click of a button. It provides instant access to update your php.ini configuration file. When you are ready to restart the server, simply use the WampServer menu to restart it. For PHP developers, this saves a great deal of time.

By default, your WampServer is only available from the computer that it is installed on, but you can place your WampServer on the Internet through the WampServer menu. However, I would not recommend using WampServer in a production environment. You should have an IT manager that is responsible for managing your production server with Apache, PHP, and MySQL installations. When running a publicly accessible server, you need to ensure that you have the latest security updates on all software as well as a firewall. Even this does not make your server foolproof. You need to learn to write secure PHP code. I personally recommend running a LAMP configuration for production use. This involves running Linux with Apache, PHP, and MySQL.

WampServer is perfect for developing applications on Windows platforms and greatly reduces the hassle of configuration.

Friday, July 4, 2008

Virtual Private Servers

I just tried out a virtual private server from VPSLink. Their most basic plan gives users a server with 64 MBs ram, 2.5 GBs hard drive space and 100 GBs bandwidth per month for only $7.95 a month. This is a great deal compared to many other VPS hosting plans and there is no setup fee. A virtual private server gives you root access to your server and a unique IP address for hosting a wide array of services. This is perfect for developers or rather any linux users. It's extremely convenient to have a reliable server online that you can SSH to from anywhere. They have a nice shell applet that you can use to SSH from a web browser. There are no port restrictions so you can host anything including a web server, file server, game server or your own custom application. I was able to easily run Apache with PHP. You may wish to optimize it for your server by adjusting the number of threads in the apache.conf file.

VPSLink gives you the option to choose from a variety of different operating systems. You can reboot your virtual server almost instantly or reinstall the operating system at no additional cost if you want to try out something new. This is a great alternative to purchasing a costly dedicated server. It is also nice because you can test out your applications before upgrading to a dedicated server. The downside is that you can't run too many applications at a single time due to the memory and processing constraints, but you can upgrade at the click of a button. It is not intended as a replacement solution for a dedicated server or a high traffic service. Before spending hundreds on the best plan, consider looking into dedicated servers. Overall, they offer a cost effective VPS solution. The biggest benefit is that you essentially have root access to your virtual machine so your options are limitless. You can view their website at vpslink.com.