我在Ubuntu 12.04.4 LTS(GNU / Linux 3.8.0-44-generic i686)上安装了unixodbc,freetds,php,我的查询工作正常:
php /var/www/connect.php
但是当访问 localhost / connect.php 时,我得到:
Warning: odbc_connect(): SQL error: [unixODBC][Driver Manager]Data source name not found, and no default driver specified, SQL state IM002 in SQLConnect in /var/www/connect.php on line 8 Warning: odbc_exec() expects parameter 1 to be resource, boolean given in /var/www/connect.php on line 10 Warning: odbc_fetch_row() expects parameter 1 to be resource, null given in /var/www/connect.php on line 11 Warning: odbc_close() expects parameter 1 to be resource, boolean given in /var/www/connect.php on line 15
我认为是关于权限的。