Page 1 of 1

fgets

Posted: Thu Jul 24, 2003 5:51 am
by eternal
On install on systems with older versions of php, there is a bug with fgets, and that it requires a length param.

Attempting to setup Database...

Warning: Wrong parameter count for fgets() in /home/web/blog.paupau.org/htdocs/serendipity_admin_installer.inc.php on line 142


fix :

in serendipity_admin_installer.inc.php
on line 141 $line = trim(fgets($fp));
this should be $line = trim(fgets($fp, '4096'));

This will fix the problem.

Posted: Fri Jul 25, 2003 7:58 pm
by mmacfadden
As for the fgets() problem, I can assume that you are using php 4.1 or earlier. As of php version 4.2, the length argument to fgets is now optional.

string fgets ( resource handle [, int length])

That is the current function spec for php 4.3. If you put a length in it will work. Or you can upgrade to php 4.2 or later.

Posted: Sat Jul 26, 2003 5:22 pm
by eternal
mmcfadden: I know it's the php version thing, just mainly posted it here for documentation purposes...not to mention since the string is optional, and it does no detriment to put it in, it might be a good idea, since that stops it from working on systems with older php.

Posted: Sat Jul 26, 2003 5:58 pm
by mmacfadden
eternal: Fair enough :-). I just ran into the problem when I tried to install and was offering information to people who don't want to edit the code.

Posted: Tue Sep 02, 2003 6:51 pm
by tomsommer
Fixed :)

Thanks guys