News Me wrote:
bird wrote:
bird wrote:
Jeb Hunter wrote:
who owns the folder?
The folder modes is as below:
----------------------------------
drwxrwxrwx 9 kmei student 4096 Feb 18 22:31 www
----------------------------------
The parent of 'www' is my home on the server. please see the path:
/home/lookout/u2/kmei/www/test1.php
'kmei' is my ID on the server.
[snip]
3) If I use command line to execute the perl code,
perl perlcode.pl
the code can correctly write the output file: 'filename'
When the webserver (apache..?) executes the script (perl or php), it's
not running as kmei:student, it's probably running as apache:apache or
whatever user:group the server administrator has configured apache to
run as. Whatever user:group apache runs as needs to have read-execute
privilege through all dirs in the path up to www, where it also needs
write privilege; it needs read-write privilege on test1.php.
NM
Yes, I think I understand your point. I knew it's different to run the
PHP/perl code by a command line or by a web browser. That's why I didn't
mention the above 3) case when I first asked for help. I actually set
the mode of every related file and folder to 777, since I have been
trying hard to find the "bug". By saying that I mean the mode of the two
files 'test1.php' and 'filename' were set to 777, and so was the folder
'www'. Thus, 'all users' including 'apache' and 'nobody' should have the
read-write-execute privilege to all the related files.
I wonder if the administrator has done something special to the system,
or it's a bug in the system, or whatever beyond my knowledge. I am just
curious to learn it. (Note that I've already achieved my goal to
implement the same function by PHP+MySQL on the university server; I
write data to MySQL database instead of a local file.)
Thank you very much,
Kevin