fopen() throwing a 500 error

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
andym01480
Forum Contributor
Posts: 390
Joined: Wed Apr 19, 2006 5:01 pm

fopen() throwing a 500 error

Post by andym01480 »

Just playing with a script to edit .htpasswd that is safely above public_html on an apache server.

When the script is in the root

Code: Select all

$fh=fopen("../.htpasswd",w);
works fine
When the script is in the next directory down

Code: Select all

$fh=fopen("../../.htpasswd",w);
throws a 500 server error.
Any idea why???
jmut
Forum Regular
Posts: 945
Joined: Tue Jul 05, 2005 3:54 am
Location: Sofia, Bulgaria
Contact:

Post by jmut »

try using full paths instead of relative and give use exact error using error_reporting(E_ALL)
Post Reply