Post by xcurtx » Mon Sep 12, 2016 9:15 pm

So my site that has been working for years suddenly generates this error on frontend


Warning: fopen(/web/markr/parfumorigo.hu/system/logs/error.txt) [function.fopen]: failed to open stream: Value too large for defined data type in /web/markr/parfumorigo.hu/system/library/log.php on line 12

Warning: fwrite(): supplied argument is not a valid stream resource in /web/markr/parfumorigo.hu/system/library/log.php on line 14

Warning: fclose(): supplied argument is not a valid stream resource in /web/markr/parfumorigo.hu/system/library/log.php on line 16

After this error the page is displayed below as per normal. I tried looking for this particular problem with no luck here on forums. So could someone give me some info on how to deal with this?

Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by villagedefrance » Mon Sep 12, 2016 9:21 pm

It looks like your log file ("error.txt") is full!

You just need to empty it.

OpenCart custom solutions @ https://villagedefrance.net


User avatar
Active Member

Posts

Joined
Wed Oct 13, 2010 10:35 pm
Location - UK

Post by xcurtx » Mon Sep 12, 2016 9:52 pm

villagedefrance wrote:It looks like your log file ("error.txt") is full!

You just need to empty it.
Unfortunately i already did that, it did not fix the issue.

Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by villagedefrance » Mon Sep 12, 2016 10:00 pm

Ok, so is the actual file "error.txt" effectively empty (file size = 0)? ... and the actual file permissions still allowing Read/Write (644 or 777)?

OpenCart custom solutions @ https://villagedefrance.net


User avatar
Active Member

Posts

Joined
Wed Oct 13, 2010 10:35 pm
Location - UK

Post by xcurtx » Mon Sep 12, 2016 10:01 pm

villagedefrance wrote:Ok, so is the actual file "error.txt" effectively empty (file size = 0)? ... and the actual file permissions still allowing Read/Write (644 or 777)?
Empty txt under system/logs/error.txt, and premissions set to 777

Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by xcurtx » Mon Sep 12, 2016 10:05 pm


Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by villagedefrance » Mon Sep 12, 2016 10:33 pm

Is your code similar to this in your system/library/log.php file?

Code: Select all

public function write($message) {
		$file = DIR_LOGS . $this->filename;

		$handle = fopen($file, 'a');

		fwrite($handle, date('Y-m-d G:i:s') . ' - ' . print_r($message, true) . "\n");

		fclose($handle);
	}

OpenCart custom solutions @ https://villagedefrance.net


User avatar
Active Member

Posts

Joined
Wed Oct 13, 2010 10:35 pm
Location - UK

Post by xcurtx » Mon Sep 12, 2016 10:56 pm

This is the code of the mentioned .php
<?php
class Log {
private $filename;

public function __construct($filename) {
$this->filename = $filename;
}

public function write($message) {
$file = DIR_LOGS . $this->filename;

$handle = fopen($file, 'a+');

fwrite($handle, date('Y-m-d G:i:s') . ' - ' . print_r($message, true) . "\n");

fclose($handle);
}
}
?>

Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by xcurtx » Tue Sep 13, 2016 5:13 am

im willing to pay someone to fix it at this point, cant figure out my self...

Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by xcurtx » Tue Sep 13, 2016 5:26 am

Just manage to solve the issue by deleting everything contained in the logs folder.
Recreated index.html and error.txt and set up the permission again to 777. Dunno why just deleting the content previously didn't work. But now it's solved.

Newbie

Posts

Joined
Mon Sep 12, 2016 9:12 pm

Post by Cue4cheap » Tue Sep 13, 2016 5:51 am

777 isn't good. 755 is better.

Mike

cue4cheap not cheap quality


Active Member

Posts

Joined
Fri Sep 20, 2013 4:45 am
Who is online

Users browsing this forum: shahab7073 and 9 guests