Upgrade PHP5.5.33 in Linux PHP5.3

Source: Internet
Author: User

Upgrade PHP5.5.33 in Linux PHP5.3

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 the yum source lastest is only 5.4, laravel5.1 must be php5.5, and several online yum sources are added. Due to various problems, compilation and installation are only troublesome.

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/local/apache2/bin/apxs -- with-mysql2 make3 make install

# I found a problem with the pdo_mysql extension.
#./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:

<?phpecho phpinfo();

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.

Deep understanding of ini configuration in PHP

Analyze the timeout mechanism of PHP scripts

Build a PHP development environment under Ubuntu 14.04 PDF

PHP 7 innovation and Performance Optimization

PHP 7, you deserve it

Experience PHP 7.0 on CentOS 7.x/Fedora 21

Install LNMP in CentOS 6.3 (PHP 5.4, MyySQL5.6)

Nginx startup failure occurs during LNMP deployment.

Ubuntu install Nginx php5-fpm MySQL (LNMP environment setup)

Detailed php hd scanning PDF + CD source code + full set of teaching videos

Configure the php lnmp development environment in CentOS 6

PHP details: click here
PHP: click here

This article permanently updates the link address:

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.