dtrb96410 2011-12-06 12:58
浏览 176
已采纳

PHP模块编译API不正确(无法初始化)

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
  • 写回答

2条回答 默认 最新

  • dsfdsfds521521 2011-12-06 14:35
    关注

    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

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部