Installation Freetds
Freetds official website http://www.freetds.org, you can go to the official website to download the program, download the text version is 0.92.79.
wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-0.92.79.tar.gz
Then extract and compile and install
tar -zxvf freetds-0.92.79.tar.gz cd freetds-0.92.79 ./configure --prefix=/usr/local/freetds gmake gmake install
After the installation is complete, you can use the command test
/ Usr / local / freetds / bin / tsql -S 192.168.0.10:1433 -U sa
Installing PHP MSSQL extension
This server uses lnmp integrated environment, php 5.3.21 is; if it is installed php alone, too; the first directory into the PHP file after downloading pressurized, then compile and install
cd /data/lnmp0.9-full/php-5.3.21 cd ext/mssql /usr/local/php/bin/phpize ./configure --with-php-config=/usr/local/php/bin/php-config --with-mssql=/usr/local/freetds make make install
Then add the extension in php.ini
vim /usr/local/php/etc/php.ini
In the last join his party
extension = "mssql.so"
Finally, you can restart php
Configuration Freetds
vim /usr/local/freetds/etc/freetds.conf
By adding the following statement in the file
[sqlservername] host = 192.168.0.10 port = 1433 tds version = 7.0 client charset = UTF-8
PHP test connection
Create a php file, add the following code
$conn = mssql_connect("sqlservername", "sa", "password") or die ("无法连接"); echo $conn;
Now you have php fully support the SQL Server connection.
php linux environment, install ftp extension
1, into the PHP install source package, locate the ftp under ext, enter
cd /home/local/php-5.6.25/ext/ftp
2、/usr/local/php/bin/phpize
3、./configure --with-php-config=/usr/local/php/bin/php-config --enable-ftp
4、make && make install
5, vim /usr/local/php/etc/php.ini added: extension = ftp.so
6、重启apache,/usr/local/apache/bin/apachectl restart
7, to see if the installation was successful: / usr / local / php / bin / php -m
Description ftp find success
1, into the PHP install source package, locate the ftp under ext, enter
cd /home/local/php-5.6.25/ext/ftp
2、/usr/local/php/bin/phpize
3、./configure --with-php-config=/usr/local/php/bin/php-config --enable-ftp
4、make && make install
5, vim /usr/local/php/etc/php.ini added: extension = ftp.so
6、重启apache,/usr/local/apache/bin/apachectl restart
7, to see if the installation was successful: / usr / local / php / bin / php -m
Description ftp find success