我在 centos 5 32 位,php 版本 5.2.4 上编译
配置选项:
'./configure' '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/var/lib' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-file=../config.cache' '--with-libdir=lib' '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d' '--disable-debug' '--with-pic' '--disable-rpath' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-dir=/usr' '--with-png-dir=/usr' '--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm' '--with-gettext' '--with-gmp' '--with-iconv' '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr' '--with-zlib' '--with-layout=GNU' '--enable-exif' '--enable-ftp' '--enable-magic-quotes' '--enable-sockets' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop' '--enable-calendar' '--with-libxml-dir=/usr' '--enable-xml' '--with-apxs2=/usr/sbin/apxs' '--without-gd' '--disable-dom' '--disable-dba' '--without-unixODBC' '--without-pspell' '--disable-wddx' '--disable-posix' '--disable-sysvmsg' '--disable-sysvshm' '--disable-sysvsem' '--with-mysqli=/usr/bin/mysql_config' '--with-mysql' '--enable-mbstring' '--with-mysql=/usr/bin/mysql_config' '--with-pdo-mysql=/usr/bin/mysql_config' '--enable-zip' '--enable-soap' '--with-gd=/usr' '--with-ldap' '--prefix=/usr/local/freetds' '--with-mssql=/usr/local/freetds'
我使用本指南安装了 freetds
我仍然收到错误
[root@portal-test php]# /usr/bin/php -v
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/20060613/mssql.so' - /usr/lib/20060613/mssql.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/20060613/pdo.so' - /usr/lib/20060613/pdo.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP 5.2.4 (cli) (built: Feb 14 2013 12:47:23)
Copyright (c) 1997-2007 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies
模块不存在
[root@portal-test php-5.2.4]# ll /usr/lib/20060613/mssql.so
ls: /usr/lib/20060613/mssql.so: No such file or directory
一个发现向我展示了以下内容
[root@portal-test php-5.2.4]# find / -type f -name "mssql.so"
/usr/src/redhat/BUILD/php-5.2.4/build-cgi/ext/mssql/.libs/mssql.so
/usr/src/redhat/BUILD/php-5.2.4/build-cgi/modules/mssql.so
/usr/src/redhat/BUILD/php-5.2.6/build-cgi/ext/mssql/.libs/mssql.so
/usr/src/redhat/BUILD/php-5.2.6/build-cgi/modules/mssql.so
使用的符号链接
[root@portal-test php-5.2.4]# cd /usr/lib
[root@portal-test lib]# ln -s /usr/src/redhat/BUILD/php-5.2.4/build-cgi/ext/mssql/.libs/ 20060613
我现在收到以下错误:
PHP Warning: mssql_connect(): Unable to connect to server: 172.16.0.71 in /opt/invload/include/config.php on line 3