
26th April 2012, 21:29
|
|
Junior Member
|
|
Join Date: Apr 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Error: Warning: fread() [function.fread]: Length parameter ...
Not really sure if this goes in this forum, or the Apache server forum, but we have a linux mail server, and an online webmail login. Sometimes, when users try to login, they will receive an error reading something like this:
Warning: fread() [function.fread]: Length parameter must be greater
than 0 in /home/admispconfig/ispconfig/web/webmail/inc/lib.php on line
106
Warning: Cannot modify header information - headers already sent by
(output started at
/home/admispconfig/ispconfig/web/webmail/inc/lib.php:106) in
/home/admispconfig/ispconfig/web/webmail/inc/inc.php on line 103
If I restart the mail server, the issue goes away. It will then resurface within a week or two.
Any ideas, suggestion, or direction?
|

27th April 2012, 13:11
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
What webmail package do you use? SquirrelMail, RoundCube, etc.?
|

27th April 2012, 14:10
|
|
Junior Member
|
|
Join Date: Apr 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Hi Falko,
Thanks for the response. The mail package is Uebimiau.
|

28th April 2012, 09:37
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
Can you post the lines around line 106 from /home/admispconfig/ispconfig/web/webmail/inc/lib.php?
|

30th April 2012, 15:27
|
|
Junior Member
|
|
Join Date: Apr 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Hi Falko,
These are lines 70 to 140. Thanks.
PHP Code:
root@mail:/home/admispconfig/ispconfig/web/webmail/inc# sed -n '70,140p' lib.php function array_qsort2 (&$array, $column=0, $order="ASC", $first=0, $last= -2) { if($last == -2) $last = count($array) - 1; if($last > $first) { $alpha = $first; $omega = $last; $guess = $array[$alpha][$column]; while($omega >= $alpha) { if($order == "ASC") { while(strtolower($array[$alpha][$column]) < strtolower($guess)) $alpha++; while(strtolower($array[$omega][$column]) > strtolower($guess)) $omega--; } else { while(strtolower($array[$alpha][$column]) > strtolower($guess)) $alpha++; while(strtolower($array[$omega][$column]) < strtolower($guess)) $omega--; } if(strtolower($alpha) > strtolower($omega)) break; $temporary = $array[$alpha]; $array[$alpha++] = $array[$omega]; $array[$omega--] = $temporary; } array_qsort2 ($array, $column, $order, $first, $omega); array_qsort2 ($array, $column, $order, $alpha, $last); } }
class Session {
var $temp_folder; var $sid;
function Load() { $sessionfile = $this->temp_folder."_sessions/".$this->sid.".usf"; $result = Array(); if(file_exists($sessionfile)) { clearstatcache(); $fp = fopen($sessionfile,"rb"); $result = fread($fp,filesize($sessionfile)); fclose($fp); $result = unserialize(base64_decode($result)); } return $result; }
function Save(&$array2save) { $content = base64_encode(serialize($array2save)); if(!is_writable($this->temp_folder)) die("<h3>The folder \"".$this->temp_folder."\" is not writtable or does not exist!!!</h3>"); $sessiondir = $this->temp_folder."_sessions/"; if(!file_exists($sessiondir)) mkdir($sessiondir,0777); $f = fopen("$sessiondir".$this->sid.".usf","wb") or die("<h3>Could not open session file</h3>"); fwrite($f,$content); fclose($f); return 1; } function Kill() { $sessionfile = $this->temp_folder."_sessions/".$this->sid.".usf"; return @unlink($sessionfile); } }
// load settings function load_prefs() {
global $userfolder, $sess, $default_preferences;
extract($default_preferences);
$pref_file = $userfolder."_infos/prefs.upf";
|

1st May 2012, 15:56
|
|
Super Moderator
|
|
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,665
Thanks: 1,896
Thanked 2,592 Times in 2,443 Posts
|
|
Code:
function Load() {
$sessionfile = $this->temp_folder."_sessions/".$this->sid.".usf";
$result = Array();
if(file_exists($sessionfile)) {
clearstatcache();
$fp = fopen($sessionfile,"rb");
$result = fread($fp,filesize($sessionfile));
fclose($fp);
$result = unserialize(base64_decode($result));
}
return $result;
}
Looks as if the session file exists, but is empty. I think you should delete all session files in the temp folder.
|

1st May 2012, 16:58
|
|
Junior Member
|
|
Join Date: Apr 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Sorry for my ignorance, but sessions files are listed as what?
I'm in home/admispconfig/ispconfig/temp/
And then open the 'webmail' directory. There I find a list of all (or most) of the email users. (ie emailaddress_localhost) Are those what I should delete?
ps there is a lot of ispconfig.log.*.tar.gz files in the ispconfig directory. Are they fine?
|

7th May 2012, 14:01
|
|
Junior Member
|
|
Join Date: Apr 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
? bumpppppp
|

8th May 2012, 09:04
|
|
Junior Member
|
|
Join Date: Dec 2007
Location: seattle washington
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
session is there but empty...
may i suggest to look that your cookies may show that you actually have 2 simultaneous sessions. look at the "PATH" for the sessions. happened to me. reads one, writes another. pretty easy fix.
|

8th May 2012, 21:12
|
|
Junior Member
|
|
Join Date: Apr 2012
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
|
|
Thanks Public_Domain.
Any additional thoughts Falko?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT +2. The time now is 09:11.
|
Recent comments
2 days 9 min ago
2 days 8 hours ago
2 days 11 hours ago
2 days 13 hours ago
2 days 14 hours ago
2 days 16 hours ago
2 days 17 hours ago
2 days 18 hours ago
3 days 10 hours ago
3 days 11 hours ago