First see if the module contains php5_module (shared) :
[Email protected] ~]#/usr/local/apache2/bin/apachectl-m
Normally the display contains php5_module (shared)and we reboot:
[Email protected] ~]#/usr/local/apache2/bin/apachectl restart
we enter in the browser: 192.168.137.66 display "It works" , which indicates that Apache is working properly.
So we do not know the "It Works" page information in the directory of Apache?
So we edit the Aapche configuration file:
[Email protected] ~]# vim/usr/local/apache2/conf/httpd.conf
ServerRoot "/usr/local/apache2" # # Apache's Directory
Listen 80 # # Listening 80 ports
LoadModule Php5_module modules/libphp5.so # # is a dynamic module that is automatically loaded by APXS
ServerAdmin [email protected] # # Admin Mailbox
documentroot "/usr/local/apache2/htdocs" # # This is the it,works corresponding file directory
We go to the "/usr/local/apache2/htdocs" directory:
[Email protected] ~]# Cd/usr/local/apache2/htdocs
In this directory we create the info.php file to see if we can parse:
[Email protected] ~]# vim info.php
<?php
Phpinfo ();
?>
: Wq
The input 192.168.137.66/info.php found in the browser does not support parsing, stating that it is not configured properly.
We re-edit the Apache configuration file:
[Email protected] htdocs]# vim/usr/local/apache2/conf/httpd.conf
The first step: find the following two lines through/addtype:
AddType application/x-compress. Z
AddType application/x-gzip. gz. tgz
We'll add another line at the back:
AddType application/x-httpd-php. php
Step Two: find this line through/index:
<ifmodule dir_module>
DirectoryIndex index.html
</IfModule>
change the line to read:
<ifmodule dir_module>
DirectoryIndex index.html index.php
</IfModule>
: Wq
[Email protected]nux www]#/usr/local/apache2/bin/apachectl-t
[Email protected] www]#/usr/local/apache2/bin/apachectl restart
Enter 192.168.137.66/info.php parse successfully in the browser.
Add:
/usr/local/php/bin/php-i |less # # View PHP compilation parameters, parsing effect
Cat/usr/local/apache2/build/config.nice # # View the Apache compilation parameters
Cat/usr/local/mysql/bin/mysqlbug |grep-i Config # # see the compiler parameters for PHP
We generate a PHP configuration file:
[Email protected] ~]#
Cp/usr/local/src/php-5.5.26/php.ini-production/usr/local/php/etc/php.ini
Reload, generate configuration file "PHP.ini"
/usr/local/apache2/bin/apachectl Graceful
Lamp Parsing test PHP