LinuxQuestions.org
Visit Jeremy's Blog.
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, 12:03 PM   #1
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Rep: Reputation: 188Reputation: 188
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, 06:30 PM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,158

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
You can post your code and the error from the apache logs.
 
Old 07-02-2010, 02: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, 07:38 PM   #4
custangro
Senior Member
 
Registered: Nov 2006
Location: California
Distribution: Fedora , CentOS , Solaris 10, RHEL
Posts: 1,935
Blog Entries: 1

Original Poster
Rep: Reputation: 188Reputation: 188
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 07:48 PM
run php script from command line blizunt7 Programming 11 11-06-2008 12:59 PM
Apache, PHP, and JAVA_HOME on the command line. neocookie Linux - Server 1 01-18-2008 08:31 AM
Apache PHP != Command Line PHP? wh33t Linux - Server 3 10-23-2007 10:21 PM
script runs fine from a command line, but doesn't work from cron? kleptophobiac Linux - Software 5 05-03-2004 05:14 PM


All times are GMT -5. The time now is 08:11 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration