Problems caused by the coexistence of multiple versions of PHP

WBOY
Release: 2016-08-10 09:07:31
Original
1157 people have browsed it

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

So an error occurred, which means that the version of the php extension I compiled is different

<code>PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20121212</code>
Copy after login
Copy after login

I probably discovered the reason, because the version using php-fpm -v is 5.5, the version displayed by php -v is 5.3, and phpize uses 5.3.

So I deleted the compiled so file, re-decompressed the source code package to compile, and used version 5.5 of phpize. I found that it was still the same when I restarted, and it was of no use.

<code>$ /usr/local/php/bin/phpize -v
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212

$ sudo /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
$ make
$ sudo make install</code>
Copy after login
Copy after login

How should I solve this situation? It is impossible for me to delete version 5.3, because it is on the server and may be used by others.

Reply content:

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

So an error occurred, which means that the version of the php extension I compiled is different

<code>PHP Warning:  PHP Startup: redis: Unable to initialize module
Module compiled with module API=20100525
PHP    compiled with module API=20121212</code>
Copy after login
Copy after login

I probably discovered the reason, because the version using php-fpm -v is 5.5, the version displayed by php -v is 5.3, and phpize uses 5.3.

So I deleted the compiled so file, re-decompressed the source code package to compile, and used version 5.5 of phpize. I found that it was still the same when I restarted, and it was of no use.

<code>$ /usr/local/php/bin/phpize -v
Configuring for:
PHP Api Version:         20121113
Zend Module Api No:      20121212
Zend Extension Api No:   220121212

$ sudo /usr/local/php/bin/phpize
$ ./configure --with-php-config=/usr/local/php/bin/php-config
$ make
$ sudo make install</code>
Copy after login
Copy after login

How should I solve this situation? It is impossible for me to delete version 5.3, because it is on the server and may be used by others.

PHP-config path is correct

Related labels:
php
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!