Re: [PHP] Re: File not rewritable - why? Help needed.
If the file does not exists, the web server needs write priviledge to the directory where you want to create it. Paul Dunkel wrote: Marek Kilimajer wrote: use chmod 755 directory on each directory that is in the way to your file I tried that, too. Didn't help. Here is the code, stripped to the original, straight from the tutorial. And I can't get it work. What's wrong here? $somecontent = 'PERKELE\n'; $filename = 'teksti.txt'; $handle = fopen($filename, 'wb'); fwrite($handle, $somecontent); fclose($handle); I've tried this in two totally different servers, tomorrow I'll try on the third one. All help absolutely welcome! Paul Dunkel -- pdunkel.nic.fi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File not rewritable - why? Help needed.
thank you for the reply Chmod was just a try from my side to get it work. I tried CHMOD 0777, and everything else, too. Didn't work. Could it be that the server doesn't allow writings at all? As you see, I am a newbie in these things. Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. How do I give those permissions? What I try next, is the same PHP in a couple of another servers... Yours, Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
try CHMOD 777 - Original Message - From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, February 12, 2003 9:22 AM Subject: [PHP] Re: File not rewritable - why? Help needed. thank you for the reply Chmod was just a try from my side to get it work. I tried CHMOD 0777, and everything else, too. Didn't work. Could it be that the server doesn't allow writings at all? As you see, I am a newbie in these things. Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. How do I give those permissions? What I try next, is the same PHP in a couple of another servers... Yours, Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Also make sure server has read permission to directories. [EMAIL PROTECTED] wrote: thank you for the reply Chmod was just a try from my side to get it work. I tried CHMOD 0777, and everything else, too. Didn't work. Could it be that the server doesn't allow writings at all? As you see, I am a newbie in these things. Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. How do I give those permissions? What I try next, is the same PHP in a couple of another servers... Yours, Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Awlad Hussain wrote: try CHMOD 777 I tried that. It didn't help. I also tried in two other servers with no result. I'm definetly doing something wrong :-( More ideas? Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Marek Kilimajer wrote: Also make sure server has read permission to directories. I'm pretty sure that is the problem. How should I check that? I've now tried my PHP in two other servers with no result. I'm definetly doing something wrong :-( Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
use chmod 755 directory on each directory that is in the way to your file [EMAIL PROTECTED] wrote: Marek Kilimajer wrote: Also make sure server has read permission to directories. I'm pretty sure that is the problem. How should I check that? I've now tried my PHP in two other servers with no result. I'm definetly doing something wrong :-( Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: File not rewritable - why? Help needed.
Marek Kilimajer wrote: use chmod 755 directory on each directory that is in the way to your file I tried that, too. Didn't help. Here is the code, stripped to the original, straight from the tutorial. And I can't get it work. What's wrong here? $somecontent = 'PERKELE\n'; $filename = 'teksti.txt'; $handle = fopen($filename, 'wb'); fwrite($handle, $somecontent); fclose($handle); I've tried this in two totally different servers, tomorrow I'll try on the third one. All help absolutely welcome! Paul Dunkel -- pdunkel.nic.fi -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: File not rewritable - why? Help needed.
Are you on a Windows platform, or *nix. I would assume *nix since you mentioned chmod. what did you chmod the file to? who owns the file? and what user does PHP run as (maybe nobody, or httpd)? Just to get it to work chmod the file to 777, BUT this is a security risk. MAKE SURE this file is NOT in the web folder (or any of it's subfolders). Remember to write to a file PHP (the user nobody or httpd) also needs Read and eXecute permisions on all the directories from the root all the way to the directory contaning the file. [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Newbie question: I try to modify a txt-file but get not writable error. (just like in http://www.php.net/manual/en/function.fwrite.php ) I've tried to change the chmode but now I need some help. All info welcome! Thanks in advance! Paul Dunkel -- [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php