Loading title...
Intexnet home page
Solutions page Downloads page About us Contact us Snippets Intexnet home page

PHP

What is PHP

PHP stands for PHP Hypertext Processor. This is known as a recursive acronym that appeals to the sense of humour of some strange people ;-)

PHP is conceptually similar to ASP (active server pages) or JSP (Java server pages) in which in-line scripting code is mingled with HTML in a single page. Microsoft's ASP is language independant, although most developers use Microsoft JScript, VBScript (and a minority use PerlScript). JSP uses Java and PHP uses its own language which is loosely derived form Perl.  

Advantages

PHP is open source and platform independant. Brave souls can compile a version for their own system, while less brave souls can choose from a selection of binary downloads for all of the most common platforms. (I fall into the latter group).

PHP is very simple to learn, I built a simple discussion group application from scratch in a day and a half with no prior experience in PHP. This involved a back-end database (MySQL), mutliple topics and user logins. (I admit that I have had some experience with Perl).

PHP has an extensive library of functions and shares some powerful features with Perl, such as associative arrays, regular expression and "here text" syntax. The function library includes support for complex array and string handling, MySQL and other database connection, ... get the PHP documentation, its too much for this short article.

Limitations

Unlike commercial development environmwnts, it is a little harder to put together an integrated editor, debugger and help system for PHP development. This is a minor limitation only as there are systems available but I have had mized success.

Installation of PHP is not difficult, but many installation options require editing the PHP configuration file. Sometimes a fair amount of trial and error is required to get going.

Other than that, the only limitation is that PHP must be installed on the web server.

Installation

Compiled binaries are available for the most common operating systems. Windows users can choose from a compact installation via a Windows installer (MSI) file, or a full download with all the ancilliary files. I found that I needed both, as the installation from the full download did not work correctly, so I installed the MSI file first and then used the files from full download.

CGI vs ISAPI

Until recently, PHP was used as a CGI application. As of version 4.1, you also have the option of running it as an in-process ISAPI application on Windows IIS 4/5. Because ISAPI is in-process and multithreaded, it is faster; but the documentation indicates that this is not yet completely stable, so I have stuck to the CGI version. The same applies to in-process APIs for other Windows web servers and servers on other platforms. 

The PHP.ini file

PHP is controlled by the options set in the PHP.ini file. This file is installed to a platform dependant location - typically the c:\Winnt folder on Windows. The default installation of PHP.ini will get you going, but many of the specialised functions and debugging require editing of the file. My installation included heavily commented versions of the PHP.ini file, but you will have to do a fair amount of experimentation.

Developing PHP applications

PHP does not include an integrated development environment (IDE). You can develop PGP applications with nothing more than a simple text editor(like Visual N++ aka Windows Notepad),. If productivity is relevant however, there are several PHP specific editors around. 

Most of these editors have colour highlighting. Some have auto completion and coding shortcut features. A few claim to be IDEs, with integrated debugging. I have had limited success with these IDEs. The ones that I have tried are PHPEd (from www.phped.de), PHPEdit (from www.phpedit.com) and PHP Coder (now called Maguma PHP4EE Studio, from www.maguma.com).Only PHPEdit has any documentation, and that is incomplete.

There are one or two commercial IDEs for PHP. Check out ActiveState

Technical support 

The PHP manual is comprehensive, but mostly of a reference nature. This is not a problem for experienced developers who are aleady familiar with many of the concapts, but is a problem for newer developers.

There are a number of web sites devoted to PHP. I have found DevShed and PHPuilder to be very useful.

Conclusion

PHP is a powerful platform independant system for developing web applications. Please feel free to drop me a line at jonathan@intexnet.co.za if you wish for more information or assistance with developing PHP based applications.

See also