I'm fighting with this for a day now, hope someone already faced with this problem and can help me out:
I have a CentOs server
[root@XXXXX ~]# cat /etc/redhat-release CentOS release 6.5 (Final)
which would be a webserver with PHP enabled (already installed, php-mssql package too)
[root@XXXXX ~]# php -i phpinfo() PHP Version => 5.3.3 ... Configuration ... mssql MSSQL Support => enabled ... Library version => FreeTDS
There is an index.php with
$cn = mssql_connect($dbserver,$dbusername,$dbpassword) or die("Connection Error");
$dbserver, $dbusername, $dbpassword double checked.
If I call it from the browser it throws Connection Error, but if I compile it in terminal as root it works:
[root@XXXXX ~]# php /var/www/html/index.php <h1> SQL CONNECTION TEST: </h1> <h2> Result </h2> Connection OK!Query OK!
I guess it's a missing permission from apache's account, but which?
Thanks for your help in advance!