[PHP] fwrite fopen problem
System Windows XP: PHP 5 I have a folder in which I want to write files. The IUSR_... user has full control, yet I am still getting failed to open stream and permission dined errors. Any suggestions? I have done this same task on many XP machines and 2003 servers. I am totally stumped. Jeremy Schreckhise, M.B.A.
RE: [PHP] fwrite fopen problem
Fixed by re-assigning IUSR... to directory security. Cheers. -Original Message- From: Jeremy Schreckhise [mailto:[EMAIL PROTECTED] Sent: Wednesday, August 16, 2006 10:59 AM To: php-general@lists.php.net Subject: [PHP] fwrite fopen problem System Windows XP: PHP 5 I have a folder in which I want to write files. The IUSR_... user has full control, yet I am still getting failed to open stream and permission dined errors. Any suggestions? I have done this same task on many XP machines and 2003 servers. I am totally stumped. Jeremy Schreckhise, M.B.A. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] fwrite/fopen
fwrite failed for quota disc exceeded, so I end up with empty file. the algorithm is something like : if (! $fp = @fopen($config['pagecachedir'].$path.$tmp_value,'wb')) { $errorLog .= Writing problem for .$config['pagecachedir']. $path$tmp_value!\n; } else { $txt_length = strlen($txt); if (@fwrite($fp,$txt,$txt_length) != $txt_length) { $errorLog .= Writing problem in file !\n; @fclose($fp); @unlink($config['pagecachedir'].$path.$tmp_value); } else { //everything is OK @fclose($fp); } On 6/11/05, Richard Lynch [EMAIL PROTECTED] wrote: You would probably have to fclose it before you can unlink it, and if it's fargled enough that fwrite failed, you probably can't fclose it successfully... Your best bet would be to put the filename into a database table, then run a cron job that deletes all the files in that table, and only takes them out of the table if they are successfully deleted. Course, you then want to be sure you have UNIQUE filenames so you don't delete a good file later. On Fri, June 10, 2005 4:03 pm, Mister Jack said: Hi, I having a problem at the moment, I open a file, try to write in it, and then remove the file if the write goes wrong (if write count != of my initial buffer length). But I still get some empty file (and then a blank page). Could possibly fopen (with a 'wb' flag, and under freebsd 4.11) failed but still create that empty file ? Where could I get more info on the behavior of fopen/fwrite ? Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- Like Music? http://l-i-e.com/artists.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] fwrite/fopen
Hi, I having a problem at the moment, I open a file, try to write in it, and then remove the file if the write goes wrong (if write count != of my initial buffer length). But I still get some empty file (and then a blank page). Could possibly fopen (with a 'wb' flag, and under freebsd 4.11) failed but still create that empty file ? Where could I get more info on the behavior of fopen/fwrite ? Thanks for your help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fwrite, fopen, or fread limit?
I highly doubt that was all. Now uploads bigger than 7megs are allowed, you should also make sure your script is able to deal with it files LARGER than that. Hmm, maybe this didn't seem to make much sense. What I'm talking about is this: memory_limit = 8M ; Maximum amount of memory a script may consume (8MB) When using fwrite you probably load the entire file into memory and have a high chance on exceeding the size of 8MB. Or if you're smart you do it line by line and there's less problem with it. Also I'd like to point you to the move_uploaded_file function. Just in case you didn't know about it. Greetz, Wouter ( sorry for the messy kinda post. I'm just all too confused about the disappointing Matrix Revolutions... I'd like to compare it to a third-level rip off of The Lord of the Rings (trilogy) meets Star Wars ) -Original Message- From: Mike At Spy [mailto:[EMAIL PROTECTED] Sent: Tuesday 04 November 2003 18:55 To: Roger Spears Cc: [EMAIL PROTECTED] Subject: RE: [PHP] fwrite, fopen, or fread limit? Yes, that was it. Thanks! :) -Mike -Original Message- From: Roger Spears [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 12:45 PM To: Mike At Spy Subject: Re: [PHP] fwrite, fopen, or fread limit? check the php.ini file, there may be a file upload limit placed there. I ran into a similar problem awhile backI think it's called max_file_upload or something like that... Thanks, Roger Mike At Spy wrote: Does anyone know if the commands for fwrite, fopen, or fread have memory limits in dealing with large files? I created a system for uploading files to a server. Small files work fine. Larger ones (around 7 megs) do not work at all. Thanks, -Mike -- 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
[PHP] fwrite, fopen, or fread limit?
Does anyone know if the commands for fwrite, fopen, or fread have memory limits in dealing with large files? I created a system for uploading files to a server. Small files work fine. Larger ones (around 7 megs) do not work at all. Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fwrite, fopen, or fread limit?
[snip] Does anyone know if the commands for fwrite, fopen, or fread have memory limits in dealing with large files? I created a system for uploading files to a server. Small files work fine. Larger ones (around 7 megs) do not work at all. [/snip] Have you checked your upload_max_filesize in php.ini? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] fwrite, fopen, or fread limit?
Yes, that was it. Thanks! :) -Mike -Original Message- From: Roger Spears [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 04, 2003 12:45 PM To: Mike At Spy Subject: Re: [PHP] fwrite, fopen, or fread limit? check the php.ini file, there may be a file upload limit placed there. I ran into a similar problem awhile backI think it's called max_file_upload or something like that... Thanks, Roger Mike At Spy wrote: Does anyone know if the commands for fwrite, fopen, or fread have memory limits in dealing with large files? I created a system for uploading files to a server. Small files work fine. Larger ones (around 7 megs) do not work at all. Thanks, -Mike -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php