编译PHP5.2.13以支持unixODBC

发现用以下参数编译时,既不报错,但unixODBC死活也装不上,花了不少时间检查,原来是odbc应该是大写
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php/etc --with-iconv=/usr/local/libiconv  --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/local/libxml2 --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-exif --enable-calendar --enable-magic-quotes --enable-wddx --enable-dba --with-qdbm  --with-pdo-mysql --enable-ftp--with-unixodbc=/usr    &&  make && make install

正常后又遇到了问题,报错:
configure: error: ODBC header file '/usr/local/incl/sqlext.h' not found!
这问题很好解决,yum -y install unixODBC-devel

最后贴下正常编译php-5.2.13时支持unixODBC的选项,以备忘
./configure --prefix=/usr/local/php --with-apxs2=/usr/local/apache2/bin/apxs --with-mysql=/usr/local/mysql --with-mysqli=/usr/local/mysql/bin/mysql_config --with-config-file-path=/usr/local/php/etc --with-iconv=/usr/local/libiconv  --with-freetype-dir --with-jpeg-dir --with-png-dir --with-zlib --with-libxml-dir=/usr/local/libxml2 --enable-xml --disable-rpath --enable-discard-path --enable-safe-mode --enable-bcmath --enable-shmop --enable-sysvsem --enable-inline-optimization --with-curl --with-curlwrappers --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --enable-gd-native-ttf --with-openssl --with-mhash --enable-sockets --with-xmlrpc --enable-zip --enable-soap --enable-exif --enable-calendar --enable-magic-quotes --enable-wddx --enable-dba --with-qdbm  --with-pdo-mysql --enable-ftp --with-unixODBC=/usr/   &&  make && make install

编译PHP5.2.13以支持unixODBC

相关推荐