Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




29.12. PHP4 server-side scripting

If you intend to use PHP4 server-side scripting language support with your Apache web server don't forget to include in your /etc/httpd/conf/httpd.conf file the following lines to enable this feature:

  1. Edit the httpd.conf file, vi /etc/httpd/conf/httpd.conf, and add the following lines between the section tags <IfModule mod_mime.c> and </IfModule>:
              AddType application/x-httpd-php .php
              AddType application/x-httpd-php .php3
              AddType application/x-httpd-php-source .phps

  2. You must restart the Apache web server for the changes to take effect, using the following commands:
              [root@deep ]/# /etc/rc.d/init.d/httpd restart
          Shutting down https:                                        	[  OK  ]
              Starting httpd:                                            	[  OK  ]

  3. Once the above lines have been included in our httpd.conf file, we must test the new PHP4 feature to be sure it's working. We'll create a small PHP file named php.php in our DocumentRoot, and then point our web broswer to this PHP document to see if PHP4 work on the server. Create the php.php file in your DocumentRoot, touch /home/httpd/ona/php.php and add the following lines in the PHP file:
              <body bgcolor="#FFFFFF">
              <?php phpinfo()?>
    These lines will inform PHP4 program to display various pieces of information about the configuration of our Linux server.

  4. Now, point your web browser to the following address:https://my-web-server/php.php The <my-web-server> is the address where your Apache web server resides, and <php.php> is the PHP document we have created above to display the information and configuration of our Linux server.

PHP info

If you see something like the above page appearing in your web browser congratulations! Your PHP module is working.

  Published under the terms of the Open Publication License Design by Interspire