Well, as /home/anithing/ was no writable even by chmod 777 it, I've  
created a new directory at:
/var/www/server/  and now, the script is able to write to a file  
without problem.

My problem now is that the same script should execute something, and  
it is not doing it.

The script now is:


#!/usr/bin/perl
use CGI;
my $q = new CGI;
print $q->header();

$user = $q->param('user');
$pass = $q->param('pass');

if($user eq "Eduard" && $pass eq "xxxxx"){
$filecontents = $q->param('filecontents');

#this is the line I replaced ant now the file.txt appears as expected
#open(FILE,">/home/server/file.txt") or die;
open(FILE,">/var/www/server/file.txt") or die;
print FILE $filecontents;
close(FILE);

#this is the line that is not working now:
system("wall New_file_written");

#nor this one, which is a call to another script located at /var/www/ 
server/
system("cd /var/www/server\n./executemyfile.pl");

print "hi $user!";
}
else{print "You are not authorized!"}


On Apr 1, 2008, at 12:10 AM, [EMAIL PROTECTED] wrote:

> I'd be looking at the server's http error log. anything the script  
> kicked
> out, msg-wise will be there. You should also put some info in your  
> 'open'
> stmt's die clause:
> open(FILE,">/home/server/file.txt") or die;
>
> s/b:
> open(FILE,">/home/server/file.txt")
>    or die "Can't write home/server/file.txt: $!";
>
>> I don't know if this happens because of the https. I've set the
>> permissions of /home/server dir to 777, and also the same for all
>> files inside the directory, but
>> I cannot write a file inside this directory.
>
> This isn't anything important is it? This seems like the worst sort of
> admin flailing. There's only one file there file.txt that'd matter and
> /home also needs to be open enough for the user the web server is  
> running
> as to be able to see server and file.txt.  Your bare 'die' would put  
> some
> msg in the httpd error_log but by adding the info above (the "$!"  
> would
> give the human version of the OS error) it may be obvious.   But you  
> can't
> do cgi programming w/o the httpd error log.
>
> a
>
> -------------------
> Andy Bach
> Systems Mangler
> Internet: [EMAIL PROTECTED]
> Voice: (608) 261-5738 Fax: 264-5932
>
> "It's true that I've driven through a number of red lights. But on the
> other
> hand, I've stopped at a lot of green ones I've never gotten credit  
> for"
> Glen Gould
>
> _______________________________________________
> ActivePerl mailing list
> [email protected]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to