0
votes

After migrating a Wordpress site from a development server to the live site, I'm getting the following errors:

Warning: include() [function.include]: Failed opening '/home/content/83/11353583/html/wp-content/themes/mmaevents/includes/widgets/category-list.php' for inclusion (include_path='.:/usr/local/php5/lib/php') in /home/content/83/11353583/html/wp-content/themes/mmaevents/includes/theme-widgets.php on line 13

There's a number of those errors.

The code for theme-widgets.php is below:

include( get_template_directory() . '/includes/widgets/1-column-post-list.php' );
include( get_template_directory() . '/includes/widgets/2-column-box-post-list.php' );
include( get_template_directory() . '/includes/widgets/carousel-post-list.php' );
include( get_template_directory() . '/includes/widgets/tab-post-list.php' );
include( get_template_directory() . '/includes/widgets/tags-list.php' );
include( get_template_directory() . '/includes/widgets/category-list.php' );
include( get_template_directory() . '/includes/widgets/popular-post-list.php' );
include( get_template_directory() . '/includes/widgets/embedded-video.php' );
include( get_template_directory() . '/includes/widgets/flickr-shots.php' );
include( get_template_directory() . '/includes/widgets/social-profiles.php' );
include( get_template_directory() . '/includes/widgets/ad-leaderboard.php' );
include( get_template_directory() . '/includes/widgets/ad-skyscraper.php' );
include( get_template_directory() . '/includes/widgets/ad-square-popup.php' );

Any ideas why I'm getting these errors?

3
Is the includes/widget directory intact in your theme directory?Chris Herbert

3 Answers

0
votes

This mean u dont have the files in the correct location ... Where the php file is located you should also have a directory /includes/widgets/1-column-post-list.php ... You could also spell out the entire url to these files but probably not necessary

0
votes

It means it can't find those files, possibly they didn't get migrated with everything else?

It's also possible your php search path is different on the dev server from the production server. So those files aren't in a directory directly under the place where the file that's including them lives. So there might be a difference between the php.ini files on each server. (See more here).

Ideally you'd fix the php.ini, but if you can't you can use the set_include_path() function somewhere before the plugins are included (more details here).

0
votes

instead of:

get_template_directory()

try

bloginfo('template_url')