Home > Article > Backend Development > How to install php3 under UNIX system_PHP tutorial
# cd /usr/src
# tar xvzf apache_1.3.6.tar.gz (Generate apache_1.3.6 directory)
# tar xvzf php-3.0.8.tar.gz (Generate php-3.0.8 directory)
# cd apache_1.3.6
# ./configure --prefix=/usr/local/apache (Set the installation directory of Apache as /usr/local/apache)
# cd php-3.0.8
# ./configure --with-mysql=/usr/local/mysql
--with-apache=../apache_1.3.6
--enable-track-vars (Configuration supports MySQL, as Apache function modules and tracking variables are valid)
# make; make install
In the configure parameters above, specify that PHP supports MySQL and give the installation path of MySQL.
Then, edit the Apache configuration file:
# cd /usr/local/apache/conf
# vi httpd.conf
Find "AddType application/x-httpd-php3 .php3" and remove it # comment mark before the line.
Of course, you can also add a line of AddType application/x-httpd-php3.asp, which will be more convenient to edit with FrontPage.
Then copy the php.ini file to the /usr/local/lib/ directory:
# cd ../php-3.0.8
# cp php3.ini-dist /usr/local/lib /php3.ini
You can modify this configuration file to customize the working details of PHP3, for example:
upload_max_filesize = 2097152 ; 2 Meg default limit on file uploads
To limit the maximum amount of uploaded file data to 2 megabytes.