PM:s get length=0 [message #11745] |
Wed, 16 July 2003 13:18 |
sverre
Messages: 11 Registered: February 2002
Karma: 0
|
Junior Member |
|
|
Hi. I'm running 2.3.2 on a FreeBSD machine and yesterday the PM:s sent started not to have any message body. The text gets written into the file, and the table fud_pmsg seems to be correctly updated, except that length is set to 0.
Any ideas what this may be?
The problem appeared after I upgraded the machine to newest mod_php4, so I suspect that is a part of the problem... but how?
|
|
|
Re: PM:s get length=0 [message #11746 is a reply to message #11745] |
Wed, 16 July 2003 14:03 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
First of all try upgrading to 2.3.9RC1 (latest release in the 2.3.X) branch and try again, unless you can/want to upgrade to 2.5.0.
The problem could the result of fwrite or ftell not returning the correct result, but rather returning 0. This a a problem you occasionaly see on systems where there is a limit on the maximum size a file can grow to.
One thing you could try, is to run a message compactor, which will remove some of the unneeded stuff from the data files (where message bodies) are stored reducing their size.
FUDforum Core Developer
|
|
|
|
Re: PM:s get length=0 [message #11751 is a reply to message #11749] |
Wed, 16 July 2003 14:28 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Which version of php4 are you using now and which version were you using beforfe?
I do see how your addition fixes the problem, you force php to go to the end of the file. However this operation should not be necessary since
<?php fopen("file", "ab"); ?>
should place the file pointer at the end of the file.
Since this sort of an addition is not in 2.5.0 you can for now hold off upgrading while I investiage this issue further.
Meanwhile please try the following test script and let me know what are the results.
<?php $fp = fopen("test", "w"); fwrite($fp, str_repeat("abc", 1024)); fclose($fp);
$fp = fopen("test", "a"); echo "Before fseek()\n"; var_dump(ftell($fp), filesize("test")); fseek($fp, 0, SEEK_END); echo "After fseek()\n"; var_dump(ftell($fp), filesize("test")); fclose($fp); ?>
FUDforum Core Developer
|
|
|
|
Re: PM:s get length=0 [message #11753 is a reply to message #11752] |
Wed, 16 July 2003 14:53 |
Ilia
Messages: 13241 Registered: January 2002
Karma: 0
|
Senior Member Administrator Core Developer |
|
|
Hmm that's the same version I am using as well... and interestingly enough I was able to replicate the problem on linux as well.
For now do not upgrade I will investigate the issue further to determine if this is a PHP bug or intended behaviour (comments in php manual by other users indicate that this was the case for a while now) and consider an appropriate solution. For now, use your fix and keep an eye for the 2.5.1 release, which will definately have some sort of a solution to this problem.
FUDforum Core Developer
|
|
|