Why use PHP instead of __? This is a question hundreds of people ask me every year. I get paid to answer the question for American and European organisations. Australians try to get the answer free by inviting me to speak on the topic at a non-profit organisation. The answer is still the same no matter how much you pay the person giving the answer. The answer just becomes more detailed and specific as the price goes up.
I looked at one of my presentations on this question from early 2001. The reasons for PHP have increased since then. That arguments against PHP have weakened.
Total cost of ownership (TCO) has increased in priority. More businesses are treating software based projects that same as their other projects and looking at TCO. Software used to be a small proportion of the cost. Today hardware is cheaper and developers are paid less than half the rate they were paid back in 2001. That means the software cost has doubled in proportion to everything else.
PHP is free.
The commercial software vendors are becoming paranoid about their software. Some software has so much anti piracy protection built in that it is impossible to reliably deploy the software. There are software vendors building software with invasive monitoring systems that are far worse than any of the viruses and worms arriving in your email.
I stopped buying updates to some products because the products behaved like spyware. The products are not open source which means I cannot actually see what they are doing. Why would I pay money for software that is spying on me when I can get a similar product from the open source community with guaranteed no spyware?
PHP has no licensing issues, no registration procedure, and no spyware.
Back in 2001 mainframe operating systems were dropping out of the server picture as IBM focused on Linux. Since then Apple has, for the third time, dumped their existing operating system forcing their customers through a massive upgrade. Most of the moves in the Web server area are from something proprietary to Linux. Apple's move to NetBSD is the one exception.
PHP runs on Linux. It also runs on NetBSD and Apple's brand of NetBSD. PHP runs on Microsoft's reliable NT and far less reliable Windows. PHP runs on Microsoft's slow fusion of Windows and NT named Windows 2000 Professional Edition. PHP runs on Microsoft's even slower XP. You could already run PHP on many of the operating systems being thrown out and you can run PHP on all the operating systems being brought in for Web servers.
The market used to say that PHP was not viable until PHP ran on operating system x. Now the market says an operating system is not viable for Web serving until the operating system runs PHP.
Availability of People
You want a good supply of people for your Web development projects. I have watched people struggle for months to produce their first working Java program. PHP beginners become productive in a few days. That easy learning difference means there are many more PHP programmers available than for other programming languages even though many universities teach only Java.
You want experienced people. A team of three beginners is unpredictable. A team of two beginners and one experienced PHP developer works with as little as 5% of development time devoted to skill upgrades. The same ratio would fail with other programming languages.
Microsoft's Visual Basic comes closest to PHP for availability and ease of learning. The problem with Visual Basic is that there are so many versions of Visual Basic. You have to spend a few weeks teaching people the differences between the Visual Basic they know and the Visual Basic available on the web server.
Many projects struggle on slow test servers. The developers use the latest super fast workstation to access a slow server across an overloaded network. The workstation uses 1% of resources to play music in to the developer's headphones and 0.1% of resources to run a teletype emulation session (TTY) so the developer can use a crude text editor on the server. Why do they not use the full resources of the workstation?
Some development environments let your workstation run a hyped up editor that does syntax checking and all sorts of other helpful things. You still have to go back to the server for testing.
PHP lets you run everything on your workstation. You can edit and test. Even on an old Windows workstation you can run PHP with the Apache Web server and the popular MySQL database. You can load them on to a notebook and develop Web sites while on the train to work.
If you are developing a PHP based Web site on travel and own a tandem bicycle, jump on the back seat, add a solar panel to power your notebook, then develop your Web site while pedalling across Australia's deserts. You will need someone on the front of the bike to steer. They could work the digital camera. Make sure they are not head down in Photoshop when you are riding through traffic.
PHP lets you distribute all the development work to individual developer's computers. You only need a server to integrate results. I have seen PHP's flexible approach save a $35,000 server upgrade for a medium size development project.
How does PHP affect real life costs? I mentioned the money saved by not having to upgrade a server. Recalculate that project's budget in today's environment. Removing the server upgrade would save 10% of the initial cost. The reduced software license costs associated with PHP would cut another 5%.
If the same project has ongoing costs from the first year recalculated to today's costs, an open source PHP approach would save close to 20% per year.
A 15% saving up front and a 20% saving per year for three years produces a TCO saving of