Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > General

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 26th April 2012, 21:29
thinkpad thinkpad is offline
Junior Member
 
Join Date: Apr 2012
Posts: 11
Thanks: 1
Thanked 4 Times in 4 Posts
Default 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?
Reply With Quote
Sponsored Links
  #2  
Old 27th April 2012, 13:11
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

What webmail package do you use? SquirrelMail, RoundCube, etc.?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 27th April 2012, 14:10
thinkpad thinkpad is offline
Junior Member
 
Join Date: Apr 2012
Posts: 11
Thanks: 1
Thanked 4 Times in 4 Posts
Default

Hi Falko,

Thanks for the response. The mail package is Uebimiau.
Reply With Quote
  #4  
Old 28th April 2012, 09:37
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

Can you post the lines around line 106 from /home/admispconfig/ispconfig/web/webmail/inc/lib.php?
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
The Following User Says Thank You to falko For This Useful Post:
bowlAltetle (25th July 2014)
  #5  
Old 30th April 2012, 15:27
thinkpad thinkpad is offline
Junior Member
 
Join Date: Apr 2012
Posts: 11
Thanks: 1
Thanked 4 Times in 4 Posts
Default

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"
Reply With Quote
The Following User Says Thank You to thinkpad For This Useful Post:
bowlAltetle (26th July 2014)
  #6  
Old 1st May 2012, 15:56
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,743 Times in 2,577 Posts
Default

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.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 1st May 2012, 16:58
thinkpad thinkpad is offline
Junior Member
 
Join Date: Apr 2012
Posts: 11
Thanks: 1
Thanked 4 Times in 4 Posts
Default

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?
Reply With Quote
The Following User Says Thank You to thinkpad For This Useful Post:
bowlAltetle (24th July 2014)
  #8  
Old 7th May 2012, 14:01
thinkpad thinkpad is offline
Junior Member
 
Join Date: Apr 2012
Posts: 11
Thanks: 1
Thanked 4 Times in 4 Posts
Default

? bumpppppp
Reply With Quote
The Following User Says Thank You to thinkpad For This Useful Post:
Williamsl (8th July 2014)
  #9  
Old 8th May 2012, 09:04
public_domain public_domain is offline
Junior Member
 
Join Date: Dec 2007
Location: seattle washington
Posts: 20
Thanks: 0
Thanked 1 Time in 1 Post
Default 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.
Reply With Quote
The Following User Says Thank You to public_domain For This Useful Post:
bowlAltetle (26th July 2014)
  #10  
Old 8th May 2012, 21:12
thinkpad thinkpad is offline
Junior Member
 
Join Date: Apr 2012
Posts: 11
Thanks: 1
Thanked 4 Times in 4 Posts
 
Default

Thanks Public_Domain.

Any additional thoughts Falko?
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
SquirrelMail login not working glenneh Installation/Configuration 13 9th April 2011 20:01
mail authentication failure - unknown user or password evok Installation/Configuration 9 16th October 2010 06:37
CGI and FormMail Cracklefish Installation/Configuration 17 13th October 2009 13:40
postfix, pop3 uvbnserved Server Operation 22 24th May 2009 21:00
Help configure Postfix to use alt port 465 or 587 BoloMarkIII Installation/Configuration 10 16th March 2009 17:57


All times are GMT +2. The time now is 03:01.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.