PHP module with incorrect compiled API (unable to initialize)

I am trying to install freetds and php-mssql in a RHEL5 field. I have successfully done (which seems to be all). However, I get the following error when PHP tries to load a module:

PHP Warning: PHP Startup: mssql: Unable to initialize module Module compiled with module API=20090626, debug=0, thread-safety=0 PHP compiled with module API=20050922, debug=0, thread-safety=0 These options need to match 

I pull out my brain, trying to understand why they are of different values, but without success.

In the last attempt, I downloaded the php source for the version I am running (php-5.3.8), went into the ext / mssql folder and ran phpize, configure, make, make install.

I checked that the mssql.so file is in the appropriate folder and this php is trying to download it.

 phpize -v Configuring for: PHP Api Version: 20050922 Zend Module Api No: 20090626 Zend Extension Api No: 220090626 
+6
source share
2 answers

RHEL had an older version of php (5.1.x), and installing new versions of php (e.g. 5.3.x) means a few changes. If you install from unofficial repositories, you will see packages with the names php- * and php5- *. Having both versions can be a source of problems.

It looks like your system is accessing some configuration files from previous php installations.

Have a look: - / etc / php.d Make sure you don’t have items from older versions - Have a look at / usr / bin / php -config *, if you have php-config and php-config5, delete (rename) / usr / bin / php-config and create a symlink to the new one:

 # mv /usr/bin/php-config /usr/bin/php-config_old # ln -s /usr/bin/php-config5 /usr/bin/php-config 

Hope this helps

+11
source

I can confirm that when the module does not load due to another API, it is due to the old php-config. Then you should look in / usr / bin / php -config and overwrite it with a newer version.

+1
source

Source: https://habr.com/ru/post/903232/


All Articles