gmmktime Error in WordPress and MagpieRSS

»»»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-techjourney/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);

By |2016-12-10T10:20:54+00:00December 10th, 2016|Categories: Web Servers|Tags: , |8 Comments

About the Author:

LK is a technology writer for Tech Journey with background of system and network administrator. He has be documenting his experiences in digital and technology world for over 15 years.Connect with LK through Tech Journey on Facebook, Twitter or Google+.