Re: script working from shell, but not from browser.
[email protected] (alexander simashin) Sat, 19 Dec 2009 10:18:24 +0300
| Newsgroups | perl.beginners.cgi |
|---|---|
| Message-ID | <[email protected]> |
--00032555a46e72b9ad047b0fa9cc Content-Type: text/plain; charset=ISO-8859-1 2009/12/19 David Taiaroa > > When you run a script from shell it's probably as user 'you'. > When the script runs from a browser, it will be as user 'www' or something > similar, with restricted permissions. Your shell user will have more > permissions, so you might want to look at file permissions. > Of course , it is running under user apache. But i made all chmod and chown what need, i think. Also, you want to check the paths to any files referenced by the script. > When runing a script as shell, you can probably access any file on the > server, but user 'www' won't be able to. > This is okay too, the script only reads config file which has the right permissions. I try to exec script from apache user from shell, after making "su -l apache -s /bin/bash" in console, and it ran perfect... But again - from browser we got an error. If you haven't already done this, try something like: > perl -cw script-name.pl > and see if it gives any more info > This gives me - "syntax OK" --00032555a46e72b9ad047b0fa9cc--