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.
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/mirror 2 #下载完改一下名字 3 5.5 . 33 . tar .gz 4 5.5 . 33 . tar . GZ php-5.5 . 33 5 cd php-5.5 . 33
2. Compiling the installation
1 ./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/local/apache2/bin/apxs--with-mysql2make3 makeinstall
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
#官网 CP php.ini-development/usr/local/lib/php.ini# My environment CP Php.ini-development/usr/local/lib /php/php.ini
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:
<? PHP Echo Phpinfo ();
The result is perfect:
Dreamingodd original articles, such as reproduced please indicate the source.
Linux PHP5.3 Upgrade PHP5.5.33