RE: [PHP] weird fopen problem
| From: | Chris Grigor | Date: | Thu, 10 Jan 2002 09:36:52 +0000 |
| Subject: | RE: [PHP] weird fopen problem | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-79994@lists.php.net to get a copy of this message | ||
I copied you script and ran it no probelm.
are you sure that apache is running as nobody?
run
ps -aux | grep httpd
mine is like this
apache 6320 0.0 5.8 49120 7248 ? S 10:54 0:00
/usr/sbin/httpd -
but yours might say
nobody 6320 0.0 5.8 49120 7248 ? S 10:54 0:00
/usr/sbin/httpd -
Can you run the script as root? if not do you get the same errors?
-----Original Message-----
From: Jon Farmer [mailto:jonfarmer@enta.net]
Sent: Thursday, January 10, 2002 11:08 AM
To: PHP General Mailing List
Subject: [PHP] weird fopen problem
I am getting a the follwing error:
Warning: fopen("/home/jon/pgpfiles/sgsdgsdg","w") - Permission denied in
/home/ethiorg/public_html/test.php on line 2
Warning: Supplied argument is not a valid File-Handle resource in
/home/ethiorg/public_html/test.php on line 3
Warning: Supplied argument is not a valid File-Handle resource in
/home/ethiorg/public_html/test.php on line 4
from the following script:
<?
$file = fopen("/home/jon/pgpfiles/sgsdgsdg","w");
fputs($file, "this is a test\n");
fclose($file);
?>
the directory /home/jon/pgpfiles has mode 777 and is owned by nobody and
group is nobody. Apache runs under user nobody.
Any ideas?
--
Jon Farmer
Systems Programmer, Entanet www.enta.net
Tel 01952 428969 Mob 07763 620378
PGP Key available, send email with subject: Send PGP Key
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net