Re: [PHP-DEV] What does this error mean?
Hello, this is not a php user mailinglist, please ask this only on the [EMAIL PROTECTED] mailinglist. The other lists you wrote to (php-qa and php-lang) are mostly for development purposes OF php. regards, Derick On Thu, 28 Jun 2001, Jimi Malcolm wrote: I'm trying to from a file in a directory called 'logs'. I've never seen this error before. What does it mean? ERROR Warning: fopen(logs/993700800.log,w+) - Permission denied in /home/sites/site20/users/guide/web/counter.php on line 28 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 29 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 30 1 END The last two errors are becuase the first fails to return a file handle. Here's the actual offending code. It's just a simple counter. CODE ?PHP $iDate = mktime(0, 0, 0, date(m), date(d), date(Y)); $iCount = 1; $sFile = logs/.$iDate..log; if (file_exists($sFile)) { $iCount = incCount($sFile); } else { createCountLog($sFile); } echo BFONT COLOR=BLUE$iCount/FONR/B; function incCount($sFile) { // Open and read existing count $hCounter = fopen($sFile, r); $iCount = fgets($hCounter, 1024); fclose($hCounter); // Write over it with the new count $hCounter = fopen($sFile, w); fputs($hCounter, ++$iCount); fclose($hCounter); return $iCount; } function createCountLog($sFile) { $hCounter = fopen($sFile, w+); fputs($hCounter, 1); fclose($hCounter); } ? END Usually I've been able to fix every PHP error I've gotten in the past - they've been pretty straightforward - but I've been playing around with this error for a few days now to no avail. I'm new to this mailing list and have never used it before so I'm not sure which one/s to join or post this specific message to. I apologize if this is the wrong forum for this type of question. Thank you for your time. -- Jimi Malcolm Web Content Manager inburst Internet Media inburst.com jimi.malcolm@inburst -- PHP Development 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] Derick Rethans - PHP: Scripting the Web - www.php.net - [EMAIL PROTECTED] SRM: Site Resource Manager - www.vl-srm.net - -- PHP Development 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-DEV] What does this error mean?
It is the wrong place, you want php-general. But the error is straight forward, you do NOT have permissions to write to that file. With that said have your system administrator make sure the user that the web server runs as has write access to the directory in which you are attempting to store your files from PHP. -Chris -Original Message- From: Jimi Malcolm [mailto:[EMAIL PROTECTED]] Sent: Thursday, 28 June, 2001 1:18 PM To: [EMAIL PROTECTED] Subject: [PHP-DEV] What does this error mean? I'm trying to from a file in a directory called 'logs'. I've never seen this error before. What does it mean? ERROR Warning: fopen(logs/993700800.log,w+) - Permission denied in /home/sites/site20/users/guide/web/counter.php on line 28 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 29 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 30 1 END The last two errors are becuase the first fails to return a file handle. Here's the actual offending code. It's just a simple counter. CODE ?PHP $iDate = mktime(0, 0, 0, date(m), date(d), date(Y)); $iCount = 1; $sFile = logs/.$iDate..log; if (file_exists($sFile)) { $iCount = incCount($sFile); } else { createCountLog($sFile); } echo BFONT COLOR=BLUE$iCount/FONR/B; function incCount($sFile) { // Open and read existing count $hCounter = fopen($sFile, r); $iCount = fgets($hCounter, 1024); fclose($hCounter); // Write over it with the new count $hCounter = fopen($sFile, w); fputs($hCounter, ++$iCount); fclose($hCounter); return $iCount; } function createCountLog($sFile) { $hCounter = fopen($sFile, w+); fputs($hCounter, 1); fclose($hCounter); } ? END Usually I've been able to fix every PHP error I've gotten in the past - they've been pretty straightforward - but I've been playing around with this error for a few days now to no avail. I'm new to this mailing list and have never used it before so I'm not sure which one/s to join or post this specific message to. I apologize if this is the wrong forum for this type of question. Thank you for your time. -- Jimi Malcolm Web Content Manager inburst Internet Media inburst.com jimi.malcolm@inburst -- PHP Development 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 Development 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-DEV] What does this error mean?
I'm trying to from a file in a directory called 'logs'. I've never seen this error before. What does it mean? ERROR Warning: fopen(logs/993700800.log,w+) - Permission denied in /home/sites/site20/users/guide/web/counter.php on line 28 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 29 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 30 1 END The last two errors are becuase the first fails to return a file handle. Here's the actual offending code. It's just a simple counter. CODE ?PHP $iDate = mktime(0, 0, 0, date(m), date(d), date(Y)); $iCount = 1; $sFile = logs/.$iDate..log; if (file_exists($sFile)) { $iCount = incCount($sFile); } else { createCountLog($sFile); } echo BFONT COLOR=BLUE$iCount/FONR/B; function incCount($sFile) { // Open and read existing count $hCounter = fopen($sFile, r); $iCount = fgets($hCounter, 1024); fclose($hCounter); // Write over it with the new count $hCounter = fopen($sFile, w); fputs($hCounter, ++$iCount); fclose($hCounter); return $iCount; } function createCountLog($sFile) { $hCounter = fopen($sFile, w+); fputs($hCounter, 1); fclose($hCounter); } ? END Usually I've been able to fix every PHP error I've gotten in the past - they've been pretty straightforward - but I've been playing around with this error for a few days now to no avail. I'm new to this mailing list and have never used it before so I'm not sure which one/s to join or post this specific message to. I apologize if this is the wrong forum for this type of question. Thank you for your time. -- Jimi Malcolm Web Content Manager inburst Internet Media inburst.com jimi.malcolm@inburst -- PHP Development 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-DEV] What does this error mean?
[EMAIL PROTECTED] or news://news.php.net/php.general Anyway, you don't have permission to write the file... type man chmod in your shell. Jeroen - Original Message - From: Jimi Malcolm [EMAIL PROTECTED] Newsgroups: php.dev Sent: Thursday, June 28, 2001 9:15 PM Subject: [PHP-DEV] What does this error mean? I'm trying to from a file in a directory called 'logs'. I've never seen this error before. What does it mean? ERROR Warning: fopen(logs/993700800.log,w+) - Permission denied in /home/sites/site20/users/guide/web/counter.php on line 28 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 29 Warning: Supplied argument is not a valid File-Handle resource in /home/sites/site20/users/guide/web/counter.php on line 30 1 END The last two errors are becuase the first fails to return a file handle. Here's the actual offending code. It's just a simple counter. CODE ?PHP $iDate = mktime(0, 0, 0, date(m), date(d), date(Y)); $iCount = 1; $sFile = logs/.$iDate..log; if (file_exists($sFile)) { $iCount = incCount($sFile); } else { createCountLog($sFile); } echo BFONT COLOR=BLUE$iCount/FONR/B; function incCount($sFile) { // Open and read existing count $hCounter = fopen($sFile, r); $iCount = fgets($hCounter, 1024); fclose($hCounter); // Write over it with the new count $hCounter = fopen($sFile, w); fputs($hCounter, ++$iCount); fclose($hCounter); return $iCount; } function createCountLog($sFile) { $hCounter = fopen($sFile, w+); fputs($hCounter, 1); fclose($hCounter); } ? END Usually I've been able to fix every PHP error I've gotten in the past - they've been pretty straightforward - but I've been playing around with this error for a few days now to no avail. I'm new to this mailing list and have never used it before so I'm not sure which one/s to join or post this specific message to. I apologize if this is the wrong forum for this type of question. Thank you for your time. -- Jimi Malcolm Web Content Manager inburst Internet Media inburst.com jimi.malcolm@inburst -- PHP Development 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 Development 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]