Hi everyone
I installed Apache 2.4 and PHP 5.5 on FreeBSD 10.1, and I also install freetds to connect MS-SQL server. But Apache error log still reporting
Below is some pkg info of apache and php 5.5
I also have /usr/local/libexec/apache24/libphp5.so and include it in apache config file ==>
The test.php is working fine
The freetds.conf, and my php script
I also can using
I think I have to set php.ini and let PHP know how to connect MSSQL by freetds, but I don't know how to do. May I miss some steps? Any suggestion will be appreciated.
I installed Apache 2.4 and PHP 5.5 on FreeBSD 10.1, and I also install freetds to connect MS-SQL server. But Apache error log still reporting
Code:
mssql_query(): Unable to connect to server
Below is some pkg info of apache and php 5.5
Code:
apache24-2.4.18 Version 2.4.x of Apache web server
mod_php5-5.4.45,1 PHP Scripting Language
php5-5.4.45 PHP Scripting Language
php5-bz2-5.4.45 The bz2 shared extension for php
php5-ctype-5.4.45 The ctype shared extension for php
php5-dom-5.4.45 The dom shared extension for php
php5-extensions-1.7 "meta-port" to install PHP extensions
php5-filter-5.4.45 The filter shared extension for php
php5-gd-5.4.45_1 The gd shared extension for php
php5-gettext-5.4.45 The gettext shared extension for php
php5-hash-5.4.45 The hash shared extension for php
php5-iconv-5.4.45 The iconv shared extension for php
php5-json-5.4.45 The json shared extension for php
php5-mbstring-5.4.45_1 The mbstring shared extension for php
php5-mcrypt-5.4.45 The mcrypt shared extension for php
php5-mssql-5.4.45 The mssql shared extension for php
php5-mysql-5.4.45 The mysql shared extension for php
php5-mysqli-5.4.45 The mysqli shared extension for php
php5-openssl-5.4.45 The openssl shared extension for php
php5-pdo-5.4.45 The pdo shared extension for php
php5-pdo_sqlite-5.4.45 The pdo_sqlite shared extension for php
php5-phar-5.4.45 The phar shared extension for php
php5-posix-5.4.45 The posix shared extension for php
php5-session-5.4.45 The session shared extension for php
php5-simplexml-5.4.45 The simplexml shared extension for php
php5-sqlite3-5.4.45 The sqlite3 shared extension for php
php5-tokenizer-5.4.45 The tokenizer shared extension for php
php5-xml-5.4.45 The xml shared extension for php
php5-xmlreader-5.4.45 The xmlreader shared extension for php
php5-xmlwriter-5.4.45 The xmlwriter shared extension for php
php5-zlib-5.4.45 The zlib shared extension for php
Code:
LoadModule php5_module libexec/apache24/libphp5.so
Code:
<?php
// Show all information, defaults to INFO_ALL
phpinfo();
?>
Code:
# A typical Microsoft server
[MSSQL]
host = 192.168.1.9
port = 1433
tds version = 7.0
client charset=UTF-8
Code:
<?
$host="MSSQL";
$usr="username";
$pw="TEST";
date_default_timezone_set("Asia/Taipei");
mssql_connect($host,$usr,$pw) or DIE("DATABASE FAILED TO RESPOND.");
mssql_select_db('globalweb');
?>
tsql -S MSSQL -U username
to connect to MS-SQL server and running select language. But webserver still can't run my php page, apache error log still reporting
Code:
mssql_query(): Unable to connect to server
I think I have to set php.ini and let PHP know how to connect MSSQL by freetds, but I don't know how to do. May I miss some steps? Any suggestion will be appreciated.