home/
procedures/
>php/
stories/
archive/
links/
portfolio/
about/ |
>PHP Hypertext Preprocessor v4.3.3 www.php.net This procedure will outline
the installation and setup of the PHP Hypertext Preprocessor for most Linux systems. PHP
is an HTML-embedded scripting language which allows web developers to write dramatically
generated pages quickly. This procedure documents an upgrade to PHP version 4.3.3 under
Apache version 1.3.9.
Assuming that the Apache webserver is running properly this a simple procedure. The
first step is to create the download directory and download the source file. I have
created the directory /etc/php for this purpose. If you are
recompiling remove the config.cache file before proceeding.
After downloading, the following steps will install php4 on your machine:
- Make sure that Apache has mod_so enabled by issuing the httpd -l command. If it does, it will return a result like the
following:
Compiled-in Modules:
http_core.c
mod_so.c
If it does not, please consult the INSTALL documentation
in the distribution. The directions are clear and easy.
- gunzip php-4.3.3.tar.gz to unzip the file
- tar -xvf php-4.3.3.tar to untar - this will create the
directory php-4.3.3. cd php-4.3.3
to change to this directory.
- ./configure --with-mysql --with apxs. If you get an error
for mysql or apxs, it will be necessary to enter the full path such as --with-mysql=/usr/local/mysql or --with-apxs=/usr/sbin/apxs.
You can locate the file locations by issuing the find / -name
<filename> command.
- make
- make install
- After installation it is necessary to copy the php.ini-dist
to the /usr/local/lib/php directory. From within the /php-4.3.3 directory issue the cp
php.ini-dist /usr/local/lib/php.ini command.
- Edit your httpd.conf file to load the PHP module. The path
on the right hand side of the LoadModule
statement must point to the path of the PHP module on your system. The make install from above may have already added this for you, but be
sure to check. Mine reads LoadModule php4_module
/usr/lib/apache/libphp4.so.
- Beneath the LoadModule in the AddModule
directives enter AddModule mod_php4.c.
- Apache needs to parse certain extensions as php so in the AddType
configurations enter AddType application/x-httpd-php .php .phtml.
I also configured Apache to show highlight php source by entering the following on the
next line: AddType application/x-httpd-php-source .phps.
- Make sure to comment out (#) or delete any prior php modules etc. I ran into errors on
the second install because of this.
- The last step is to make sure that the PHP 4 mime type line is uncommented in the httpd.conf file.
- Stop and then start, do not restart, the Apache webserver and you should be able to
serve PHP files now.
I made a test file with the tag <?phpinfo()?> and when working properly will
return a result like the following http://www.uberlinux.org/test.php. |