Lamp Parsing test PHP

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.