Re: PHP Mssql Connection Error: Permissions?

Randy Syring <[email protected]>
Newsgroups gmane.comp.db.tds.freetds
Message-ID <[email protected]>
Derrick,

Can you give us the specific error message you get when the script fails 
to run in the browser?

--------------------------------------
Randy Syring
Intelicom
Direct: 502-276-0459
Office: 502-212-9913

For the wages of sin is death, but the
free gift of God is eternal life in
Christ Jesus our Lord (Rom 6:23)


On 09/07/2011 09:51 AM, Derrick Betts wrote:
> 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
>
> If PHP wasn't compiled properly, then that script would fail, but it doesn't
> fail, it pulls all the data from the DB just fine. This script only fails
> when it is executed from the browser.
>
> Any other ideas?
>
> -----Original Message-----
> From: Armando Ortiz [mailto:[email protected]]
> Sent: Wednesday, September 07, 2011 7:50 AM
> To: [email protected]; FreeTDS Development Group
> Subject: RE: [freetds] PHP Mssql Connection Error: Permissions?
>
> My guess is that the PHP you're using isn't compiled with MSSQL support,
> which is typical of most distributions and their default PHP package.  It
> would be simpler for you to use the FreeTDS ODBC driver along with UnixODBC
> and a DB abstraction layer like ADODB, which is all kinds of WONDERFUL.
>
> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Derrick Betts
> Sent: Tuesday, September 06, 2011 4:50 PM
> To: [email protected]
> Subject: [freetds] PHP Mssql Connection Error: Permissions?
>
> I have a PHP script that makes a connection to SQL Server.
>
> > From the command line as root: tsql -H hostname -U username connects
>> just
> great and I can run queries.
>
>
>
> I have a PHP script in /var/www/html/axis/public/test.php
>
> When I: sudo -u apache -s (change the user from root to apache) and then run
> my PHP script from the command line, it connects just great.
>
> But, from the web browser, it fails. The web browser is able to connect
> everywhere it is supposed to and renders all the web pages that don't need
> an SQL connection.
>
>
>
> apache is the user that is running httpd. I've confirmed this via: ps aux |
> grep apache
>
>
>
> Any ideas as to why apache can run the PHP script and connect just fine from
> the command line, but when the browser attempts to connect to the very same
> script, it fails?
>
>
>
> Thanks,
>
> Derrick
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
> ---------------
> CONFIDENTIALITY WARNING: This email may contain privileged or confidential
> information and is for the sole use of the intended recipients. Unauthorized
> disclosure or use of this communication is prohibited. If you believe that
> you have received this email in error, please notify the sender immediately
> and delete it from your system.
>
> EXPORT WARNING: These commodities, technical data or software may be subject
> to the export control of either the International Traffic in Arms
> Regulations (ITAR) or the Export Administration Regulations (EAR) and may
> not be exported without the authorization of either the Department of State
> or the Department of Commerce prior to export. Export includes disclosure
> and or access to Commodities, technical data or software by foreign
> nationals whether located in the United States or Abroad. This requirement
> applies equally to foreign national employees of U.S. Companies and their
> foreign subsidiaries.
>
> _______________________________________________
> FreeTDS mailing list
> [email protected]
> http://lists.ibiblio.org/mailman/listinfo/freetds
>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.