Apr 16, 2006
My Digital Life Editorial Team

gmmktime Error in WordPress and MagpieRSS

If you’re running PHP 5.1 with your web server, you may encounter the following error in your Apache web server error log file (i.e. httpd-error.log) whenever there are requests to the RSS feed and the Apache need to parse the RSS in PHP:

For Magpie RSS:

PHP Warning: gmmktime() expects parameter 3 to be long, string given in …../magpie/rss_utils.inc on line 35

For WordPress 2:

PHP Warning: gmmktime() expects parameter 3 to be long, string given in /usr/local/www/apache22/data/wordpress-mydigitallife/wp-includes/rss-functions.php on line 788

The error usually only occurs if you are using or upgrading to PHP 5.1.

The resolution is to edit rss_utils.inc in MagpieRSS or rss-functions.php in WordPress and changes the line below:

$epoch = gmmktime( $hours, $minutes, $seconds, $month, $day, $year);

to the following line by adding +0 after the third variables ($seconds):

$epoch = gmmktime( $hours, $minutes, $seconds+0, $month, $day, $year);

Related posts:

  1. WordPress Permalinks Does Not Work in xampp Setup
  2. Must Have WordPress Plugins
  3. StatTraq – WordPress Plugin for Site Statistic and Traffic Counter
  4. Oracle EXP-00091 Error When Export Database
  5. WordPress WYSIWYG Visual Editor Not Working or Not Appearing

8 Comments

  • This is another way which will work if any of the other paramaters given are strings which helps to future proof against any further unknowns. It forces all of the paramaters to integers.

    $epoch = gmmktime((int)$hours, (int)$minutes, (int)$seconds, (int)$month, (int)$day, (int)$year);

  • Thanks

  • Words perfectly for me, thx

  • thank you so much! saved me alot of time

  • Great tips! Thank you very much!

  • Glad I found this! I'm surprised they haven't incorporated this into the version in Sourceforge!

  • The first Google result my own website showing the error. Your's was #3 or so. I can't thank you enough for publishing this simple fix.

  • Thanks very much for documenting this! You saved me a bunch of time and I really appreciate it.

Leave a comment

Notify me of followup comments via e-mail. You can also subscribe without commenting.

Subscribe

Free email subscriptions
Get latest updates in email for free:

Translate This Page