PHP script works on server but not from www

They have: 4 posts

Joined: Jun 2004

Hello,

I'm trying to get a PHP script to work on my Redhat server, and if I access the script via Putty, it works fine(php index.php), but if I try to access it via www it displays the page with no error(and no data), but the error_log has this entry -

sh: /ping: No such file or directory

It looks like it's trying to run PING from html root. The script is sitting in usr/local, and I'm pretty sure it's CHMOD'd and CHOWN'd correctly.

I'm new at server admin issues, so I'm hoping this is something very obvious. Laughing out loud

Thanks,

Z

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

Could be a lot of things. First thing that I would try is to see if any php works at all. Try using a simple php script like this one called test.php;

<?php
phpinfo
()
?>

This will tell you if php is working. If it isn't then you will have to enable it in your httpd.conf file. If it does print out info, then php is working and the problem lies elsewhere.

By the way, welcome to WMF.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

They have: 4 posts

Joined: Jun 2004

Thanks. I actually have a number of sites running on my server. That's what's weird. I have other tools running like MRTG as well that perform no problemo. I mimmicked the user rights of the html folder, and have even attempted to setup this folder as html is in the httpd.conf file, and still no go.

All PHP performs well, I can login via Putty and 'php index.php' from anywhere on the server, and the output has data(like server UP vs. server DOWN) but trying to access the same index.php file from a public server via a symlink produces the sh: /ping: No such file or directory error in my log file, and server DOWN.

Anything one needs to do to the 'ln -s' that I might be missing?

Z

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.