Installation:
Yum install-y httpd php
View version:,
Rpm-qa httpd PHP
Httpd-2.2.15-54.el6.centos.x86_64
Php-5.3.3-48.el6_8.x86_64
To modify the Apache configuration file:
Vim/etc/httpd/conf/httpd.conf
Add a row under #servername www.example.com:80 line
ServerName localhost:80
Change the Listen 80 inside to Listen "Your IP": 80
Can be quickly positioned with/80.
Test Apache:
Service httpd Restart
Curl-i 192.168.240.129
There is no error message and a lot of code indicates that the Apache installation was successful.
650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/86/B9/wKiom1fIVDvQpuW0AACFkoLn2UE889.png-wh_500x0-wm_3 -wmp_4-s_633067833.png "title=" 1.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px; height:80px; "alt=" Wkiom1fivdvqpuw0aacfkoln2ue889.png-wh_50 "/>
Test PHP:
Service httpd Restart
Cd/var/www/html
Vim index.php Save the following code input:
<?
Phpinfo ();
?>
Curl-i 192.168.240.129/index.php
There is no error message and a lot of code indicates that the PHP installation was successful:
650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M01/86/B8/wKioL1fIVrDB-uX8AADdzwZmoG0566.png-wh_500x0-wm_3 -wmp_4-s_518551626.png "title=" 3.png "width=" "height=" "border=" 0 "hspace=" 0 "vspace=" 0 "style=" width:200px; height:80px; "alt=" Wkiol1fivrdb-ux8aaddzwzmog0566.png-wh_50 "/>
MySQL pending test
After testing found that after the installation of the Yum Apache and PHP are automatically configured, very good, than the code compiled to be comfortable, hehe.
Yum installs Apache PHP mysql