Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Script works from command line but not from browser

Status
Not open for further replies.
Oct 27, 2002
21
0
0
US
Greetings all,
I have a Perl script that worked a couple weeks ago. I have a web form that calls the script and it is suppose to open a file and then input some text, close the file and then email the file. If I run it from my browser it creates the files but they are empty. If I run it from the command line it creates the file properly and emails them out correctly. I am thinking it is a permission issue, but the file .cgi file resides in the cgi directory. When I look at the files that are created but empty, they are created by user apache. When I do it from command line, they are created by user root. I heard from somewhere that I could set an environment variable or something, but have done searches and can't find anything. Are there any environment varibles or permissions that could stop the web browser from being allowed to execute a script. If needed I can post the html and script information.

Thanks in Advance
 
Post the script, but it does sound like permissions or path issues.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
It sounds like your script is working if the files are created. The problem seems to be why they are empty.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
You wouldn't be able to create the files if it was a permission issue. More likely is that apache doesn't have permission to read whatever input is used to create the empty files.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
i asked myself a very simple question while reading this...i propably already had the idea, but since it's not mentioned anywhere:
do you have access to log files? if it's a permission problem, shouldnt there be something in there somewhere?
cheers,
michael
 
> ...i propably already had the idea, ...

sorry, i meant *you* probably had the idea already...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top