Installing PHP

PHP works on almost all Unix platforms and with Microsoft Windows 32-bit environments. In Unix environments, PHP can be used to develop three different types of software:

Command-line scripts

PHP can be used as an alternative to Perl, Tcl, shell scripts, and other scripting languages.

GUI Windowing applications

With the PHP-GTK extension, PHP can be used to develop window-based applications.

Server-side scripts

PHP can be used to process scripts that are requested with a web browser

PHP was designed for the third alternative. To use it in this environment, a web server is required. We focus on integrating MySQL with the web environment in this chapter.

PHP can be used for web scripting by integrating it as a module of a supported web server such as Apache, Microsoft Internet Information Server (IIS), or iPlanet. For web servers that do not support module integration—those that do not support SAPI or ISAPI direct module interfacing—the PHP executable can be used as a CGI processor. The Common Gateway Interface (CGI) allows a web server to run any executable, but this is a much slower method of running the PHP engine than integrating it as a server module. In either case, to use PHP to access the MySQL DBMS, it must be compiled with MySQL support.

Get Managing & Using MySQL, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.