LinuxPHP5.3 upgrade PHP5.5.33 and php5.3php5.5.33. LinuxPHP5.3 upgrade PHP5.5.33 and php5.3php5.5.33 because laravel5.1 is used, php must be upgraded to over 5.5. The specific environment is AliyunCentOS7.0. Since Alibaba's yum source lastest only has 5.4, Linux PHP5.3 upgrades php5.33 and php5.3php5.5.33.
Because laravel5.1 is used, php must be upgraded to 5.5 or above. The specific environment is Aliyun Cent Operating System 7.0. Because Alibaba's yum source lastest is only 5.4, laravel5.1 must be php5.5, and a few online yum sources are added. due to various problems, it is only necessary to compile and install it.
First, there are a lot of articles on the internet. the purpose of each person's upgrade is that the components to be upgraded are not exactly the same. The best instruction document is the official installation document. if the installation on the php official website fails, search for related questions. I finally rely on Apache 2.x on Unix systems on the official website.
1. Download
Http://php.net/downloads.php
1 wget http://cn2.php.net/get/php-5.5.33.tar.gz/from/this/mirror2 # Download and modify the name 3 mv mirror php-5.5.33.tar.gz4 tar-zxf php-5.5.33.tar.gz php-5.5.335 cd php-5.5.33
2. Compile and install
# This step has an error #############################
./Configure -- with-apxs2 =/usr/local/apache2/bin/apxs -- with-mysql
# Error rate #############################
I have a problem in -- with-apxs2 =/usr/local/apache2/bin/apxs, removing this parameter even if it is not installed, this parameter is compiled out of libphp5.so and used in httpd. in conf, the find/-name apxs2 cannot find the result. I have been searching for a long time and found that there is a problem with apache. I don't know why 5.3 didn't have this problem (no matter ).
yum install httpd-devel
Although apxs2 still does not exist, you can find apxs:
1 find / -name apxs22 find / -name apxs3 /usr/bin/apxs
In the next few steps, the comparison is time-consuming:
1./configure -- with-apxs2 =/usr/bin/apxs -- with-mysql2 make3 make install
# I found that there was a problem with pdo_mysql extension compilation separately. I changed this sentence and re-compiled it.
#./Configure -- with-mysql = mysqlnd -- with-mysqli = mysqlnd -- with-pdo-mysql = mysqlnd -- with-apxs2 =/usr/bin/apxs
The result is as follows:
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20121212/.........Wrote PEAR system config file at: /usr/local/etc/pear.confYou may want to add: /usr/local/lib/php to your php.ini include_path/usr/local/src/php-5.5.33/build/shtool install -c ext/phar/phar.phar /usr/local/binln -s -f phar.phar /usr/local/bin/pharInstalling PDO headers: /usr/local/include/php/ext/pdo/
3. configuration
Copy php. ini
# This location must not be wrong. I didn't specify the php. ini location during compilation. configure. it is here by default,
# If you skip this step, there will be no problems in the future, but you will need to skip this step. ini, such as installing extensions, to modify/etc/php. the ini statement is invalid.
Cp php. ini-development/usr/local/lib/php. ini
# Here I suggest you change the original php. ini, so that it will not affect future find
# You may not have been here. we recommend that you find
Mv/etc/php. ini/etc/php. ini. back
Modify httpd. conf
Find/-name httpd. confvi/etc/httpd/conf/httpd. conf # add these two sentences (about 310 rows) AddType application/x-httpd-php. php. php3. phtml. incAddType application/x-httpd-php-source. phps # may be the reason for the upgrade. I already have this sentence. I didn't need to add (about 50 lines) LoadModule php5_module/usr/lib64/httpd/modules/libphp5.so.
Restart apache:
service httpd restart
Test:
php -v
Create a new phpinfo. php file for access:
Results:
You can install some dependencies, such as gd php-gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc php-imap, let's just hand over these to yum.
Original dreamingodd article. if the article is reproduced, indicate the source.
Http://www.bkjia.com/PHPjc/1115255.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/1115255.htmlTechArticleLinux PHP5.3 upgrade PHP5.5.33, php5.3php5.5.33 due to the use of laravel5.1, php to upgrade to more than 5.5. The specific environment is Aliyun Cent Operating System 7.0. Because Alibaba's yum source lastest only has 5.4 ,...