I'm trying to install freetds and php-mssql on a RHEL5 box. I've successfully done (what appears to be) everything. However, I get the following error when PHP attempts to load the 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've been pulling my brain out trying to figure out why they are different values, but having no success.
In the latest 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 verified the mssql.so file is in the appropriate folder, and that php is trying to load it.
phpize -v
Configuring for:
PHP Api Version: 20050922
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
RHEL had an older version of php (5.1.x), and the installation of newer php versions (such as 5.3.x) means several changes. If you install from unofficial repos, you will see packages named php-* and php5-* . Having both versions can be the origin of the problems.
It looks like your system is accessing some configuration files from previous php installations.
Have a look at: - /etc/php.d Be sure you do not have elements from old versions - Have a look at /usr/bin/php-config* , If you have both php-config and php-config5, remove (rename) of /usr/bin/php-config and make 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
I can confirm that when a module doesn't load because of a different API it's because of an old php-config. Then you must look in /usr/bin/php-config and overwrite it with a newer version.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With