Linux PHP5.3 Upgrade php5.5.33,php5.3php5.5.33
Because you want to use the laravel5.1,php to upgrade to more than 5.5. The specific environment is Aliyun Cent OS 7.0. Since Ali's Yum source lastest only 5.4,laravel5.1 must be php5.5, plus a few online yum sources, a variety of problems, so only troublesome compilation installed.
First of all, this kind of articles online very much, everyone upgrade purposes, to upgrade the components are not exactly the same. The best documentation is the official installation document, and if the installation of the PHP website fails, then search for related issues. I ended up relying on the official online Apache 2.x on Unix systems document.
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 change the name 3mv Mirror php-5.5. . Tar . GZ 4 tar -zxf php-5.5. . tar. GZ php-5.5. - 5 cd php-5.5. -
2. Compiling the installation
#这一步出错了 #############################
./configure--with-apxs2=/usr/local/apache2/bin/apxs--with-mysql
#这一步出错率 #############################
I--with-apxs2=/usr/local/apache2/bin/apxs this step out of the question, remove this parameter even if the installation is not, this parameter compiled libphp5.so and used in httpd.conf, find/-name APXS2 search results. I looked for a long time, found that my Apache has a problem, do not know why 5.3 without this problem (regardless of).
Yum Install Httpd-devel
Although Apxs2 still not, but can find APXS:
1 Find /-name Apxs22find /-name Apxs3 /usr/bin/apxs
The next few steps are a little bit more time consuming:
1 ./configure--with-apxs2=/usr/bin/apxs--with-mysql2make3make Install
#之后发现单独编译pdo_mysql扩展有问题, to change this. Recompile
#./configure--with-mysql=mysqlnd--with-mysqli=mysqlnd--with-pdo-mysql=mysqlnd--with-apxs2=/usr/bin/apxs
Get similar results for installation success:
Installing shared extensions: /usr/local/lib/php/extensions/no-debug-non-zts-20121212/ file at:/usr/local/etc//usr/local/lib/php to your php.ini include_path/usr/local/ src/php-5.5. - 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
#这个位置一定不能错, compile. Configure I did not make php.ini position, the default is here,
#如果跳过这一步, there will be no problems in the future, but you should php.ini, such as installing extensions, or modifying/etc/php.ini (your original) is not valid.
CP Php.ini-development/usr/local/lib/php.ini
#这里我建议把原来的php. ini to get rid of, this will not affect the future find
#你的原来不一定是这里, we suggest find it.
Mv/etc/php.ini/etc/php.ini.back
Modify Httpd.conf
Find /-name httpd.confvi /etc/httpd/conf/httpd.conf# Add these two sentences (around 310 lines) AddType Application/x-httpd-php. php. php3. phtml. Incaddtypeapplication/x-httpd-php-/usr/lib64/ Httpd/modules/libphp5.so
To restart Apache:
Service httpd Restart
Test it:
Php-v
Create a new phpinfo.php visit:
PHPechophpinfo();
The result is perfect:
You may need to install some dependencies, such as GD PHP-GD gd-devel php-xml php-common php-mbstring php-ldap php-pear php-xmlrpc Php-imap, these will be given to Yum.
Dreamingodd original articles, such as reproduced please indicate the source.
http://www.bkjia.com/PHPjc/1115255.html www.bkjia.com true http://www.bkjia.com/PHPjc/1115255.html techarticle Linux 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 OS 7.0. Since Ali's Yum source lastest only 5.4, ...