0
Thanks

A few words of thanks would be greatly appreciated.

Installing a web server (Apache, PHP and MySQL) under Linux




In this article your shall learn how to install the Apache web server on a UNIX-based system (typically a Linux distribution such as RedHat, Mandrake or any other). The following procedure includes the installation of the PHP interpreter, a programming language for creating dynamic pages as well as the MySQL database, a database management system running on Linux.
  • The PHP source can be downloaded: here
  • The Apache source can be downloaded: here
  • The MySQL source can be downloaded from: here

tar zxvf apache_1.3.x.tar.gz   
tar zxvf php-3.0.x.tar

cd apache_1.3.x   
./configure --prefix=/www

cd ../php-3.0.x   
./configure --with-mysql --with-apache=../apache_1.3.x --enable-track-vars

To install PHP in another directory, you must use the --with-config-file-path=/path configuration option:
make   
make install

cd ../apache_1.3.x   
./configure --prefix=/www --activate-module=src/modules/php3/libphp3.a   
make   
make install

cd ../php-3.0.x   
cp php3.ini-dist /usr/local/lib/php3.ini

Change extension associated with PHP scripts. For consistency, it is common to choose the .php3 extension:

Edit the configuration file of the Apache server (usually httpd.conf or srm.conf and add the following line):
AddType application/x-httpd-php3 .php3
It is important to stop and restart the server:
  • apachectl stop
  • apachectl start

To check if the installation was successful, simply create a small file in the document root of the web server ( DocumentRoot in httpd.conf). Name this file as test.php3 file and put the following code in this file:


<html>

<head><title>Example</title></head>

<body>

<?php
echo "PHP Works!";

?>

</body>

</html>
  • Open a browser on your machine and enter the following URL:
  • http://localhost/test.php3
  • Where localhost: refers to the machine on which you are ...
  • The phrase "PHP works!" should appears in your browser!

Orginal document published by Rémy Pouchain on CommentcaMarche.net
0
Thanks

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.
Related
This document, titled « Installing a web server (Apache, PHP and MySQL) under Linux », is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (ccm.net).

Subscribe To Our Newsletter!

The Best of CCM in Your Inbox

Subscribe To Our Newsletter!