Skip to Content.
Sympa Menu

freetds - Re: [freetds] PHP Mssql Connection Error: Permissions?

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Daniel Fazekas <fdsubs AT t-online.hu>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] PHP Mssql Connection Error: Permissions?
  • Date: Wed, 7 Sep 2011 16:12:08 +0200

Are you by chance running on a SELinux-enabled system?
It's possible the web server process is forbidden from opening connections to
remote servers by default.

If so, you could try these to check and read about the various options:
/usr/sbin/getsebool -a | grep httpd
man httpd_selinux

On my system, I have these:
httpd_can_network_connect --> off
httpd_can_network_connect_db --> off

So I'd first try
/usr/sbin/setsebool -P httpd_can_network_connect_db 1

And if that wasn't enough, also enable
/usr/sbin/setsebool -P httpd_can_network_connect 1

Depending on whether the port your db is listening on is considered a db port
by selinux's list.

If that wasn't it, you'll have to enable logging.
http://www.freetds.org/userguide/logging.htm
http://www.freetds.org/userguide/appendmode.htm

On Sep 7, 2011, at 15:59, Derrick Betts wrote:

> My apologies, I should have included that earlier. It's not very helpful
> however, the error from the browser is:
>
> SQLSTATE[HY000] Unable to connect: Adaptive Server is unavailable or does
> not exist (severity 9)
>
> -----Original Message-----
> From: Armando Ortiz [mailto:Armando.Ortiz AT cppcorp.com]
> Sent: Wednesday, September 07, 2011 7:58 AM
> To: derrick AT blueaxis.com; FreeTDS Development Group
> Subject: RE: [freetds] PHP Mssql Connection Error: Permissions?
>
> What does your PHP error log show when you run that script from the browser?
>
>
> -----Original Message-----
> From: freetds-bounces AT lists.ibiblio.org
> [mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Derrick Betts
> Sent: Wednesday, September 07, 2011 6:51 AM
> To: 'FreeTDS Development Group'
> Subject: Re: [freetds] PHP Mssql Connection Error: Permissions?
>
> Thank you very much for your input.
> I don't think that's the issue because I can run the PHP command as apache
> and have the script execute from the command line like so:
>
> -bash-3.2$ PHP /var/www/html/axis/public/test.php





Archive powered by MHonArc 2.6.24.

Top of Page