I am trying to get a script running on my host that creates or overwrites a small text file on my hosts web server. I am using the command fp$=fopen("test.txt", "w") and all I get back is the error Warning: fopen("test.txt", "w") - Permission denied in /usr/local/psa/home/vhosts/milltech-php.com/httpdocs/scripts/submit.php on line 9
If I use the "r" parameter instead then its quite happy!
The system is running PHP v4.1.0 on Apache and phpinfo.php returns the following for configuration " './configure' '--with-apxs=apxs' '--prefix=/home/builder/psa-dummies/psa/apache/../release/usr/local/psa/apache' '--with-system-regex' '--with-config-file-path=/usr/local/psa/apache/conf' '--disable-debug' '--disable-pear' '--enable-sockets' '--enable-track-vars' '--without-gd' '--with-mysql=/home/builder/psa-dummies/psa/apache/../release/dist/usr/local/psa/mysql' '--with-iodbc=/home/builder/psa-dummies/psa/apache/../release/lib/libiodbc' '--with-imap=/home/builder/psa-dummies/psa/apache/../release/lib/imap-cclient'"
Any help you might be able to give me to tell me whats going wrong or what permissions aren't right here would make me extremely gratefull!
Thanks
Tim west
Need help with permissions!
Moderator: General Moderators
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
Can't be just that!
Thanks for the thought but when I first fire up the script the file doesn't actually exist so there's nothing to set the permissions on! I was hoping that the script would actually create the file 'cos thats what the book says the "w" parameter will do 
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
btw - 777 is a very scary permission to set.
Here's a brief overview:
1 - exe
2 - write
4 - read
order: user/group/world (done in groups of three - rwx)
so that, if you wanted to make it full permissions for the user that owns it:
-rwx------
or
1+2+4 = 7 so .... chmod 700 filename
or, to make it read only for everyone, and allow only the user to write to it:
-rw-r--r--
or
4+2 = 6
4 (read) so..... chmod 644 filename
Here's a brief overview:
1 - exe
2 - write
4 - read
order: user/group/world (done in groups of three - rwx)
so that, if you wanted to make it full permissions for the user that owns it:
-rwx------
or
1+2+4 = 7 so .... chmod 700 filename
or, to make it read only for everyone, and allow only the user to write to it:
-rw-r--r--
or
4+2 = 6
4 (read) so..... chmod 644 filename
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact: