13.09.2016 Views

PHP and MySQL Web Development 4th Ed-tqw-_darksiderg

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Installing Apache, <strong>PHP</strong>, <strong>and</strong> <strong>MySQL</strong> Under Unix<br />

891<br />

Source Installation<br />

Let’s install Apache, <strong>PHP</strong>, <strong>and</strong> <strong>MySQL</strong> under a Unix environment. First, you need to<br />

decide which extra modules you will load under the trio. Because some of the examples<br />

covered in this book use a secure server for web transactions, you should install an SSLenabled<br />

server.<br />

For purposes of this book, the <strong>PHP</strong> configuration is more or less the default setup but<br />

also covers ways to enable the gd2 library under <strong>PHP</strong>.<br />

The gd2 library is just one of the many libraries available for <strong>PHP</strong>.We included this<br />

installation step so that you can get an idea of what is required to enable extra libraries<br />

within <strong>PHP</strong>. Compiling most Unix programs follows a similar process.<br />

You usually need to recompile <strong>PHP</strong> after installing a new library, so if you know<br />

what you need in advance, you can install all required libraries on your machine <strong>and</strong><br />

then begin to compile the <strong>PHP</strong> module.<br />

Here, we describe installation on an SuSE Linux server, but the description is generic<br />

enough to apply to other Unix servers.<br />

Start by gathering the required files for the installation.You need these items:<br />

n Apache (http://httpd.apache.org/)—The web server<br />

n OpenSSL (http://www.openssl.org/)—Open source toolkit that implements the<br />

Secure Sockets Layer<br />

n <strong>MySQL</strong> (http://www.mysql.com/)—The relational database<br />

n <strong>PHP</strong> (http://www.php.net/)—The server-side scripting language<br />

n ftp://ftp.uu.net/graphics/jpeg/—The JPEG library, needed for PDFlib <strong>and</strong> gd<br />

n http://www.libpng.org/pub/png/libpng.html—The PNG library, needed for gd<br />

n http://www.zlib.net/—The zlib library, needed for the PNG library, above<br />

n http://www.libtiff.org/—The TIFF library, needed for PDFlib<br />

n ftp://ftp.cac.washington.edu/imap/—The IMAP c client, needed for IMAP<br />

If you want to use the mail() function, you will need to have an MTA (mail transfer<br />

agent) installed, although we do not go through this here.<br />

We assume that you have root access to the server <strong>and</strong> the following tools installed on<br />

your system:<br />

n<br />

n<br />

gzip or gunzip<br />

gcc <strong>and</strong> GNU make<br />

When you are ready to begin the installation process, you should start by downloading<br />

all tar file sources to a temporary directory. Make sure you put them somewhere with<br />

plenty of space. In our case, we chose /usr/src for the temporary directory. You should<br />

download them as root to avoid permissions problems.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!