LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise
User Name
Password
Linux - Enterprise This forum is for all items relating to using Linux in the Enterprise.

Notices


Reply
  Search this Thread
Old 06-30-2010, 11:03 AM   #1
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
PHP script runs from the command line...but not on Apache


Hello,

Interesting problem...

I have a php script that does a simple select from the database; and if I run it from the command line...it returns the results as expected.

But when I run the same script through apache it hits the "or die" clause...

So I verified that the server is in the pg_hba.conf (I mean duh right? if it works from the command line)

php is running fine because the "info.php" displays correctly...

I'm at a loss...

Anyone ran into this similar issue?

What can I provide? What can I do to provide more information?

-C
 
Old 06-30-2010, 05:30 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,704

Rep: Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896Reputation: 5896
You can post your code and the error from the apache logs.
 
Old 07-02-2010, 01:55 PM   #3
kolotila
LQ Newbie
 
Registered: Apr 2009
Posts: 9

Rep: Reputation: 0
Quote:
Originally Posted by custangro View Post
Hello,

Interesting problem...

I have a php script that does a simple select from the database; and if I run it from the command line...it returns the results as expected.

But when I run the same script through apache it hits the "or die" clause...

So I verified that the server is in the pg_hba.conf (I mean duh right? if it works from the command line)

php is running fine because the "info.php" displays correctly...

I'm at a loss...

Anyone ran into this similar issue?

What can I provide? What can I do to provide more information?

-C
did you set your .bash_profile, .profile and an oraenv (or something akin to the oracle env) i had this problem just recently. cron runs with a minimal environment, that should fix ti.
 
Old 07-02-2010, 06:38 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , RHEL
Posts: 1,979

Original Poster
Blog Entries: 1

Rep: Reputation: 209Reputation: 209Reputation: 209
I did the "windows" fix and reinstalled the server and recompiled apache/php

Works fine now...I guess it will remain a mystery :\

-C
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Script runs fine from command line, but not when attempted from Cron hwest Linux - Newbie 8 12-11-2008 06:48 PM
run php script from command line blizunt7 Programming 11 11-06-2008 11:59 AM
Apache, PHP, and JAVA_HOME on the command line. neocookie Linux - Server 1 01-18-2008 07:31 AM
Apache PHP != Command Line PHP? wh33t Linux - Server 3 10-23-2007 09:21 PM
script runs fine from a command line, but doesn't work from cron? kleptophobiac Linux - Software 5 05-03-2004 04:14 PM

LinuxQuestions.org > Forums > Enterprise Linux Forums > Linux - Enterprise

All times are GMT -5. The time now is 08:35 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration