Download   Online Shop   Red Hat Network
Home  |  Products & Services  |  Support  |  Training  |  Partners  |  Documentation   
Red Hat Documentation

Configuring mod_php

Configuring mod_php

Like mod_perl, mod_php is a large package. PHP is a complete scripting language, with various capabilities. To run PHP with your Web server, you'll need to edit the httpd.conf file.

In your httpd.conf file, you need to uncomment the LoadModule and AddModule lines for the version or versions of PHP that you installed.

After the main LoadModule section, there's a list of six additional modules. If you installed PHP/FI, uncomment the php_module line so that instead of:

#LoadModule php_module  modules/mod_php.so 
	

It reads:

LoadModule php_module  modules/mod_php.so 
	

If you installed the PHP3 package, uncomment the following line instead:

#LoadModule php3_module	modules/libphp3.so
	

If you installed both the PHP/FI package and the PHP3 package, uncomment both of the previous lines.

After the main AddModule section, there's another list of six additional modules.

If you installed the PHP/FI package, uncomment the mod_php.c line so that instead of:

#AddModule mod_php.c 
	

It reads:

AddModule mod_php.c 
	

If you installed the PHP3 package, uncomment the mod_php3.c line so that instead of:

#AddModule mod_php3.c 
	

It reads:

AddModule mod_php3.c 
	

If you installed both packages, uncomment both lines.

The following three lines:

AddType application/x-httpd-php .phtml

AddType application/x-httpd-php3 .php3

AddType application/x-httpd-php3-source .phps

are in <IfModule mod_php.c> tags or <IfModule mom_php3.c> tags, so that the correct types are automatically invoked if one or both of the PHP modules are compiled in to Apache. So if you've compiled in the PHP/FI module, the PHP/FI types are enabled automatically. If you've compiled in the PHP3 module, the PHP3 types are enabled automatically.

Save your httpd.conf file, and then re-start Apache. You should now be running mod_php.

Please refer to the PHP website at http://www.php.net/ for more information about configuring, testing and using PHP.

 

 
 
Search for:  on    Powered by Google
Products & Services   :   Download   :   Support   :   Training   :   Partners & Programs
© 2001 Red Hat, Inc. All right reserved.       About Red Hat   :   Legal statement   :   Privacy statement   :   Y2K statement   :   Contact Red Hat