Testing working using phpinfo()

Let’s install Apache, PHP, and MySQL under a Unix environment. First, you need to
decide which extra modules you will load under the trio. Because some of the examples
covered in this book use a secure server for web transactions, you should install an SSLenabled
server.
For purposes of this book, the PHP configuration is more or less the default setup but
also covers ways to enable the gd2 library under PHP.
The gd2 library is just one of the many libraries available for PHP.We included this
installation step so that you can get an idea of what is required to enable extra libraries
within PHP. Compiling most Unix programs follows a similar process.
You usually need to recompile PHP after installing a new library, so if you know
what you need in advance, you can install all required libraries on your machine and
then begin to compile the PHP module.
Here, we describe installation on an SuSE Linux server, but the description is generic
enough to apply to other Unix servers.
Start by gathering the required files for the installation.You need these items:
n Apache (http://httpd.apache.org/)—The web server
n OpenSSL (http://www.openssl.org/)—Open source toolkit that implements the
Secure Sockets Layer
n MySQL (http://www.mysql.com/)—The relational database
n PHP (http://www.php.net/)—The server-side scripting language
n ftp://ftp.uu.net/graphics/jpeg/—The JPEG library, needed for PDFlib and gd
n http://www.libpng.org/pub/png/libpng.html—The PNG library, needed for gd
n http://www.zlib.net/—The zlib library, needed for the PNG library, above
n http://www.libtiff.org/—The TIFF library, needed for PDFlib
n ftp://ftp.cac.washington.edu/imap/—The IMAP c client, needed for IMAP


Is PHP  Working?
Now you can test for PHP support. Create a file named test.php with the following
code in it.The file needs to be located in document root path, which should be set up,
by default, to /usr/local/apache/htdocs. Note that this path depends on the directory
prefix that you chose initially. However, you could change this in the httpd.conf file:
<?php phpinfo(); ?>