Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
In article 012101c0c69b$b01b8d00$8b1412d1@null, [EMAIL PROTECTED] ("Chris Anderson") wrote: I tried it, even with the byte length identifer it worked perfectly for me. As a last ditch effort try changing the w to w+. If not then it sounds like a configuration issue for the webserver or php. Dunno what settings though, sorry couldn't be of more help. Thanks for testing. Was that with v4.0.4pl? I'd sure like to know whether there's any possbility it's bug. Seems unlikely, but then again so does the stubborness of frwite() in choosing its own content to write in place of mine. I've pored over phpinfo and php.ini trying to find a config setting that might be causing this weirdness, but so far nothing seems obvious. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
I am using the latest version of Apache and PHP. Sorry I couldn't be of more help. - Original Message - From: "CC Zona" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, April 17, 2001 3:01 AM Subject: Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14 In article 012101c0c69b$b01b8d00$8b1412d1@null, [EMAIL PROTECTED] ("Chris Anderson") wrote: I tried it, even with the byte length identifer it worked perfectly for me. As a last ditch effort try changing the w to w+. If not then it sounds like a configuration issue for the webserver or php. Dunno what settings though, sorry couldn't be of more help. Thanks for testing. Was that with v4.0.4pl? I'd sure like to know whether there's any possbility it's bug. Seems unlikely, but then again so does the stubborness of frwite() in choosing its own content to write in place of mine. I've pored over phpinfo and php.ini trying to find a config setting that might be causing this weirdness, but so far nothing seems obvious. -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
Have you checked the following things: A) if the file is actually there? B)Is it an include error C)Do you have the required permissions for write access and for including from that directory? - Original Message - From: "CC Zona" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 16, 2001 5:34 PM Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14 Suggestions so far have focused on parts of the function other than fwrite, so I'm trying again with a stripped-down example. After spending many hours trying to make this very simple function work again, I'm beginning to think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it was working fine before...). Before filing a bug report, would a few people test whether this fails to write on their system too? Thank you! function build_file() { $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" . $php_errormsg); fwrite($fp,"pHi, I'm some test content/p",1) or die("ERROR: fwrite " . $php_errormsg); fclose($fp) or die("ERROR: fclose" . $php_errormsg); } build_file(); //no errors and file modification date is updated echo "pBegin include...p"; //ok include("/path/to/directory/test.inc"); //NOTHING! echo "p...End includep"; //ok (Checking from the commandline, the file is definitely being set to empty. It's writing an empty string to the file instead of writing the specified content.) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
In article 002b01c0c697$9628ee00$8b1412d1@null, [EMAIL PROTECTED] ("Chris Anderson") wrote: Have you checked the following things: A) if the file is actually there? Yes. (And even when the file is not there, fopen() correctly re-creates it. And fwrite continued to write the wrong--empty--string to it.) B)Is it an include error Checked, and no. The file is being included. It just doesn't have any content to display. C)Do you have the required permissions for write access and for including from that directory? Permissions: yes (the file is updating, just with the wrong content) Including: yes (it's in the include path too) I've also checked that no other fuction is writing to the same file and that the function is not recursing (to, say, write the correct content on one pass then overwrite with empty string on the next pass). No to those too. - Original Message - From: "CC Zona" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 16, 2001 5:34 PM Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14 Suggestions so far have focused on parts of the function other than fwrite, so I'm trying again with a stripped-down example. After spending many hours trying to make this very simple function work again, I'm beginning to think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it was working fine before...). Before filing a bug report, would a few people test whether this fails to write on their system too? Thank you! function build_file() { $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" . $php_errormsg); fwrite($fp,"pHi, I'm some test content/p",1) or die("ERROR: fwrite " . $php_errormsg); fclose($fp) or die("ERROR: fclose" . $php_errormsg); } build_file(); //no errors and file modification date is updated echo "pBegin include...p"; //ok include("/path/to/directory/test.inc"); //NOTHING! echo "p...End includep"; //ok (Checking from the commandline, the file is definitely being set to empty. It's writing an empty string to the file instead of writing the specified content.) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
come to think of it, why are you passing 3 arguements to fwrite()? - Original Message - From: "CC Zona" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 16, 2001 5:34 PM Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14 Suggestions so far have focused on parts of the function other than fwrite, so I'm trying again with a stripped-down example. After spending many hours trying to make this very simple function work again, I'm beginning to think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it was working fine before...). Before filing a bug report, would a few people test whether this fails to write on their system too? Thank you! function build_file() { $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" . $php_errormsg); fwrite($fp,"pHi, I'm some test content/p",1) or die("ERROR: fwrite " . $php_errormsg); fclose($fp) or die("ERROR: fclose" . $php_errormsg); } build_file(); //no errors and file modification date is updated echo "pBegin include...p"; //ok include("/path/to/directory/test.inc"); //NOTHING! echo "p...End includep"; //ok (Checking from the commandline, the file is definitely being set to empty. It's writing an empty string to the file instead of writing the specified content.) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
alright try removing the byte length identifier - Original Message - From: "Chris Anderson" [EMAIL PROTECTED] To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Sent: Monday, April 16, 2001 1:20 PM Subject: Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14 come to think of it, why are you passing 3 arguements to fwrite()? - Original Message - From: "CC Zona" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Monday, April 16, 2001 5:34 PM Subject: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14 Suggestions so far have focused on parts of the function other than fwrite, so I'm trying again with a stripped-down example. After spending many hours trying to make this very simple function work again, I'm beginning to think fwrite in broken--either in 4.0.4pl1 (?!) or in my build of it (it was working fine before...). Before filing a bug report, would a few people test whether this fails to write on their system too? Thank you! function build_file() { $fp=fopen("/path/to/directory/test.inc","w") or die("ERROR on fopen" . $php_errormsg); fwrite($fp,"pHi, I'm some test content/p",1) or die("ERROR: fwrite " . $php_errormsg); fclose($fp) or die("ERROR: fclose" . $php_errormsg); } build_file(); //no errors and file modification date is updated echo "pBegin include...p"; //ok include("/path/to/directory/test.inc"); //NOTHING! echo "p...End includep"; //ok (Checking from the commandline, the file is definitely being set to empty. It's writing an empty string to the file instead of writing the specified content.) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] fwrite not writing (simpler example), PHP 4.0.4pl1, Apache/1.3.14
In article 006701c0c699$ad65cdc0$8b1412d1@null, [EMAIL PROTECTED] ("Chris Anderson") wrote: come to think of it, why are you passing 3 arguements to fwrite()? Whoops! That's a typo left over from the last round of tests, adding every optional argument just in case something wasn't really optional. Of course the third argument actually belongs to fopen(). Though it shouldn't be needed there either. (And yup, I just double-checked and it doesn't work without the typo either. sigh) -- CC -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]