kkamagi's story

IT, 정보보안, 포렌식, 일상 공유

OS

php-mssql 연동

까마기 2014. 11. 27. 20:58
728x90
반응형

php mssql 연동

os : Centos 5.8 32bit

*soap 모듈

*mssql 모듈

*oci8 모듈

1. freetds 설치

yum 으로 freetds 설치되어 있는지 확인

-freetds-0.82.tar.gz

# tar xvfz freetds-0.82.tar.gz

# cd freetds-0.82

./configure --prefix=/usr/local/freetds --with-tdsver=8.0 --disable-odbc --disable-debug --enable-msdblib -enable-dbmfix

# make && make install

2. mssql 모듈 추가

# cd /usr/local/src/php-5.2.17/ext/mssql
# /usr/local/php/bin/phpize
# ./configure --with-mssql=/usr/local/freetds --with-php-config=/usr/local/php/bin/php-config
# make
# make install

# cp modules/mssql.so /usr/local/php/modules
# vi /usr/local/php/etc/php.ini
extension_dir=/usr/local/php/modules/
extension=mssql.so

# /usr/local/freetds/bin/tsql -H 210.116.122.155 -p 14330 -U portalv2 -P 'portalv2!@#'

# /usr/local/php/bin/php -v

/usr/local/apache/bin/apachectl stop

/usr/local/apache/bin/apachectl start

반응형