Table of Contents
Linux PHP5.3 upgrade to PHP5.5.33, php5.3php5.5.33
Home Backend Development PHP Tutorial Linux PHP5.3 upgrade to PHP5.5.33, php5.3php5.5.33_PHP tutorial

Linux PHP5.3 upgrade to PHP5.5.33, php5.3php5.5.33_PHP tutorial

Jul 12, 2016 am 08:55 AM
php5

Linux PHP5.3 upgrade to PHP5.5.33, php5.3php5.5.33

Due to using laravel5.1, php needs to be upgraded to 5.5 or above. The specific environment is Aliyun Cent OS 7.0. Since Alibaba's yum source lastest is only 5.4, laravel5.1 requires php5.5, and several online yum sources have been added, which causes various problems, so I can only compile and install them.

First of all, there are many such articles on the Internet. Everyone’s purpose of upgrading and the components to be upgraded are not exactly the same. The best documentation is the official installation document. If the installation on the official PHP website fails, search for related issues. What I finally relied on was the document Apache 2.x on Unix systems on the official website.

1. Download

http://php.net/downloads.php

<span>1</span> <span>wget</span> http:<span>//</span><span>cn2.php.net/get/php-5.5.33.tar.gz/from/this/mirror</span>
<span>2</span> <span>#下载完改一下名字
</span><span>3</span> <span>mv</span> mirror php-<span>5.5</span>.<span>33</span>.<span>tar</span><span>.gz
</span><span>4</span> <span>tar</span> -zxf php-<span>5.5</span>.<span>33</span>.<span>tar</span>.gz php-<span>5.5</span>.<span>33</span>
<span>5</span> cd php-<span>5.5</span>.<span>33</span>
Copy after login

2. Compile and install

#这一步出错了#############################<br />./configure --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql<br />#这一步出错率#############################
Copy after login

I had a problem with the --with-apxs2=/usr/local/apache2/bin/apxs step. Even if I remove this parameter, the installation will not work. This parameter compiles libphp5.so and uses it in httpd.conf. Find No results found for / -name apxs2. I searched for a long time and found that there was a problem with my apache. I don’t know why there was no such problem in 5.3 (I don’t care).

<span>yum</span> <span>install</span> httpd-devel
Copy after login

Although apxs2 is still not available, apxs can be found:

<span>1</span> <span>find</span> / -<span>name apxs2
</span><span>2</span> <span>find</span> / -<span>name apxs
</span><span>3</span> /usr/bin/apxs
Copy after login

The next few steps will be done step by step, which is quite time-consuming:

<span>1</span> ./configure --with-apxs2=/usr/bin/apxs --with-<span>mysql
</span><span>2</span> <span>make</span>
<span>3</span> <span>make</span> <span>install<br /><br /><span>#之后发现单独编译pdo_mysql扩展有问题,换了这句重新编译</span><br /><span>#./configure --with-mysql=mysqlnd --with-mysqli=mysqlnd --with-pdo-mysql=mysqlnd --with-apxs2=/usr/bin/apxs</span><br /></span>
Copy after login

If you get similar results, the installation is successful:

Installing shared extensions:     /usr/local/lib/php/extensions/no-debug-non-zts-<span>20121212</span>/<span>
...
...
...
Wrote PEAR system config </span><span>file</span> at: /usr/local/etc/<span>pear.conf
You may want to add: </span>/usr/local/lib/<span>php to your php.ini include_path
</span>/usr/local/src/php-<span>5.5</span>.<span>33</span>/build/shtool <span>install</span> -c ext/phar/phar.phar /usr/local/<span>bin
</span><span>ln</span> -s -f phar.phar /usr/local/bin/<span>phar
Installing PDO headers:          </span>/usr/local/include/php/ext/pdo/
Copy after login

3. Configuration

Copy php.ini

#This location must not be wrong. I did not specify the location of php.ini when compiling .configure. The default location is here.
#If you skip this step, there will be no problems later, but you will need to use php in the future. ini, such as installing extensions, etc., it will be invalid if you modify /etc/php.ini (your original one).
cp php.ini-development /usr/local/lib/php.ini
#Here I suggest changing the original php.ini, so that it will not affect future find
#Your original one is not It must be here, I suggest you find it
mv /etc/php.ini /etc/php.ini.back

Modify httpd.conf

<span>find</span> / -<span>name httpd.conf
</span><span>vi</span> /etc/httpd/conf/<span>httpd.conf
#加入这两句(310行左右)
AddType application</span>/x-httpd-<span>php .php .php3 .phtml .inc
AddType application</span>/x-httpd-php-<span>source .phps
#可能是升级的原因,这一句我本来就有,没有要加(50行左右)
LoadModule php5_module </span>/usr/lib64/httpd/modules/libphp5.so
Copy after login

Restart apache:

service httpd restart
Copy after login

Test it:

php -v
Copy after login

Create a new phpinfo.php and visit:

<?<span>php
</span><span>echo</span> <span>phpinfo</span>();
Copy after login

Perfect result:

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. Leave these to yum.

dreamingodd original article, please indicate the source if reprinted.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1115255.htmlTechArticleLinux PHP5.3 upgrade PHP5.5.33, php5.3php5.5.33 Since laravel5.1 is used, php needs Upgrade to 5.5 or above. The specific environment is Aliyun Cent OS 7.0. Since Alibaba’s yum source lastest is only 5.4,...
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Hot Topics

Java Tutorial
1657
14
PHP Tutorial
1257
29
C# Tutorial
1229
24
What is the difference between php5 and php8 What is the difference between php5 and php8 Sep 25, 2023 pm 01:34 PM

The differences between php5 and php8 are in terms of performance, language structure, type system, error handling, asynchronous programming, standard library functions and security. Detailed introduction: 1. Performance improvement. Compared with PHP5, PHP8 has a huge improvement in performance. PHP8 introduces a JIT compiler, which can compile and optimize some high-frequency execution codes, thereby improving the running speed; 2. Improved language structure, PHP8 introduces some new language structures and functions. PHP8 supports named parameters, allowing developers to pass parameter names instead of parameter order, etc.

How to change port 80 in php5 How to change port 80 in php5 Jul 24, 2023 pm 04:57 PM

How to change port 80 in php5: 1. Edit the port number in the Apache server configuration file; 2. Edit the PHP configuration file to ensure that PHP works on the new port; 3. Restart the Apache server, and the PHP application will start running on the new port. run on the port.

How to solve the problem that php5 is not listening on port 9000 How to solve the problem that php5 is not listening on port 9000 Jul 10, 2023 pm 04:01 PM

Solution steps for php5 not listening to port 9000: 1. Check the PHP-FPM configuration file; 2. Restart the PHP-FPM service; 3. Turn off the firewall or configure port forwarding; 4. Check whether other processes occupy port 9000.

What is the difference between php7 and php5 syntax What is the difference between php7 and php5 syntax Jul 10, 2023 pm 03:25 PM

The syntax differences between php7 and php5 are: 1. PHP7 introduces strict type declarations, while the type of PHP5 variables is implicit; 2. PHP7 introduces support for scalar type declarations, but PHP5 does not; 3. PHP7 introduces NULL Merge operator, while PHP5 checks whether a variable exists and is not null, you need to use a conditional statement; 4. PHP7 adds a new comparison operator "<=>", but PHP5 does not; 5. PHP7 introduces a new feature anonymous class , while PHP5 does not.

How to solve the problem that php5 is not listening on port 9000 How to solve the problem that php5 is not listening on port 9000 Mar 21, 2023 pm 04:32 PM

When using PHP5, some users may encounter the situation that port 9000 cannot be listened to. At this time, we need to perform some configuration and troubleshooting work to solve this problem.

How to change port 80 in php5 How to change port 80 in php5 Mar 21, 2023 pm 04:32 PM

​If you are a website administrator, you may encounter a situation where you need to change the PHP5 port from the default port 80. This process may be a little hurried, but as long as you follow the steps below, it will be easily completed.

What are the differences between the version of php7 and 5? What are the differences between the version of php7 and 5? Sep 15, 2023 pm 04:11 PM

The differences between the version of php7 and 5 include performance improvements, scalar type declarations, return value type declarations, exception handling improvements, anonymous classes, syntax improvements, new operators, enhanced error handling and the removal of some old features. Detailed introduction: 1. Performance improvement. PHP7 introduces a new Zend engine, named Zend Engine 3.0, which brings significant performance improvement. The performance of PHP7 is approximately twice that of PHP5, mainly through improved memory management. , optimized function calls and exception handling, enhanced garbage collection, etc.

Discuss the syntax differences between PHP7 and PHP5 Discuss the syntax differences between PHP7 and PHP5 Mar 21, 2023 pm 07:10 PM

PHP is a widely used server-side programming language used to develop dynamic websites and applications. In recent years, the release of PHP7 has attracted some attention. PHP7 has many improvements and optimizations over previous versions (such as PHP5). In this article, we will explore the syntax differences between PHP7 and PHP5.

See all articles