Compiling and installing php5.4.45

Source: Internet
Author: User

1.PHP http://www.php.net/releases/

2.HTTPD http://mirrors.hust.edu.cn/apache/

Manual compilation of the installation is required because Webtatic does not provide support for the php5.4 version

https://webtatic.com/packages/php54/

650) this.width=650; "Src=" Http://s3.51cto.com/wyfs02/M01/89/57/wKioL1gQVd7T5LaZAACvIUzdAdQ810.jpg-wh_500x0-wm_3 -wmp_4-s_4161458694.jpg "title=" 193d95515e084044863e4ee15e6f8487.jpg "alt=" Wkiol1gqvd7t5lazaacviuzdadq810.jpg-wh _50 "/>

There are two types of cases:

1.yum install httpd, compile and install php5.4.45

A. Yum install httpd Httpd-devel

B. Tar zxvf php-5.4.45.tar.gz

CD php-5.4.45

Note: Before compiling and installing PHP, you must ensure that the original Yum installed php5.3 has been moved out or the libphp5.so file will not be generated.

./configure--with-apxs2=/usr/sbin/apxs--with-mysql

Make && make install

CP Php.ini-development/usr/local/lib/php.ini

Sed-i ' s%;d ate.timezone =%date.timezone = asia/shanghai% '/usr/local/lib/php.ini

Verify that the/etc/httpd/conf/httpd.conf file has already loaded the Libphp5.so module

grep "Libphp5.so"/etc/httpd/conf/httpd.conf

Add Apache parsing php file

Sed '/. gz. Tgz/a\addtype application/x-httpd-php. php '/etc/httpd/conf/httpd.conf

650) this.width=650; "Src=" Http://s1.51cto.com/wyfs02/M00/89/57/wKioL1gQVf7wrGLiAAAx2pYLcTw701.jpg-wh_500x0-wm_3 -wmp_4-s_3257942732.jpg "title=" 0fd800523df545af9efd99bb863d288e.jpg "alt=" Wkiol1gqvf7wrgliaaax2pylctw701.jpg-wh _50 "/>

2. Compile and install httpd2.2 php5.4.45

A. Tar zxvf httpd-2.2.31.tar.gz

CD httpd-2.2.31

Ls

./configure--enable-so

Make && make install

/usr/local/apache2/bin/apachectl start

Lsof-i:80

/usr/local/apache2/bin/apachectl stop

Lsof-i:80

B. cd. /

CD php-5.4.45

./configure--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql

Make && make install

CP Php.ini-development/usr/local/lib/php.ini

C. sed-i ' s%;d ate.timezone =%date.timezone = asia/shanghai% '/usr/local/lib/php.ini

Verify that the/usr/local/apache2/conf/httpd.conf file has already loaded the Libphp5.so module

grep "Libphp5.so"/usr/local/apache2/conf/httpd.conf

Add Apache parsing php file

Sed '/. gz. Tgz/a\addtype application/x-httpd-php. php '/usr/local/apache2/conf/httpd.conf

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M01/89/5A/wKiom1gQVg2SE8twAAAx2pYLcTw879.jpg-wh_500x0-wm_3 -wmp_4-s_2496266381.jpg "title=" 0fd800523df545af9efd99bb863d288e.jpg "alt=" Wkiom1gqvg2se8twaaax2pylctw879.jpg-wh _50 "/>

D. Validation

/usr/local/apache2/bin/apachectl start

echo "<?php phpinfo ();?>" > index.php

Check to see if the configuration of PHP is displayed properly.


Compiling and installing php5.4.45

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.