fgets

Found a bug? Tell us!!
Post Reply
eternal
Posts: 3
Joined: Thu Jul 24, 2003 5:40 am

fgets

Post 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.
mmacfadden
Regular
Posts: 5
Joined: Fri Jul 25, 2003 7:42 pm

Post 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.
eternal
Posts: 3
Joined: Thu Jul 24, 2003 5:40 am

Post 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.
mmacfadden
Regular
Posts: 5
Joined: Fri Jul 25, 2003 7:42 pm

Post 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.
tomsommer
Core Developer
Posts: 240
Joined: Tue Sep 02, 2003 6:43 pm
Location: Denmark
Contact:

Post by tomsommer »

Fixed :)

Thanks guys
Tom Sommer (Serendipity Core Developer)
http://blog.dreamcoder.dk
Post Reply