Problems caused by coexistence of multiple php versions

Source: Internet
Author: User
There is a server that uses nginx and php-fpm, which contains two versions of PHP, 5.3 and 5.5. now, because I want to install the new redis extension, so I downloaded the redis extension source code package from the official website, compiled and installed it, and finally in php. extensionredis is added to ini. so finally restart php-fp... there is a server that uses nginx and php-fpm, which contains two versions of PHP, 5.3 and 5.5. now, because I want to install the new redis extension, so I downloaded the redis extension source code package from the official website, compiled and installed it, and finally in php. add extension = redis to ini. so finally restart php-fpm.

So an error is reported, which means that the php extensions I compiled use different versions.

PHP Warning:  PHP Startup: redis: Unable to initialize moduleModule compiled with module API=20100525PHP    compiled with module API=20121212

Probably found out why, because of the usephp-fpm -vThe version is 5.5,php -vThe displayed version is 5.3, and phpize uses 5.3.

So I deleted the compiled so file, decompressed the source code package again, and used phpize of version 5.5. I found that it was the same when I restarted it, and it was useless.

$ /usr/local/php/bin/phpize -vConfiguring for:PHP Api Version:         20121113Zend Module Api No:      20121212Zend Extension Api No:   220121212$ sudo /usr/local/php/bin/phpize$ ./configure --with-php-config=/usr/local/php/bin/php-config$ make$ sudo make install

How can I solve this problem? It is impossible for me to delete version 5.3 because someone else may have used it on the server.

Reply content:

There is a server that uses nginx and php-fpm, which contains two versions of PHP, 5.3 and 5.5. now, because I want to install the new redis extension, so I downloaded the redis extension source code package from the official website, compiled and installed it, and finally in php. add extension = redis to ini. so finally restart php-fpm.

So an error is reported, which means that the php extensions I compiled use different versions.

PHP Warning:  PHP Startup: redis: Unable to initialize moduleModule compiled with module API=20100525PHP    compiled with module API=20121212

Probably found out why, because of the usephp-fpm -vThe version is 5.5,php -vThe displayed version is 5.3, and phpize uses 5.3.

So I deleted the compiled so file, decompressed the source code package again, and used phpize of version 5.5. I found that it was the same when I restarted it, and it was useless.

$ /usr/local/php/bin/phpize -vConfiguring for:PHP Api Version:         20121113Zend Module Api No:      20121212Zend Extension Api No:   220121212$ sudo /usr/local/php/bin/phpize$ ./configure --with-php-config=/usr/local/php/bin/php-config$ make$ sudo make install

How can I solve this problem? It is impossible for me to delete version 5.3 because someone else may have used it on the server.

PHP-config

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.