Support » Fixing WordPress » failed to open stream: No such file or directory

  • Hi,

    I’m hoping someone can help me…

    I have recently migrated a WordPress install for a client from one host to another, imported the My SQL db transferred all files and configured wp-config to the new db.

    All good but the site now returns the following error when loading the home page and you cannot access the admin dashboard whatsoever:

    Warning: include(custom_widgets.php) [function.include]: failed to open stream: No such file or directory in /data01/c9092357/public_html/wp-content/themes/thegossip/functions.php on line 21

    Warning: include() [function.include]: Failed opening ‘custom_widgets.php’ for inclusion (include_path=’/data01/c9092357/public_html/wp-content/plugins/sabai/lib:.:/usr/lib/php’) in /data01/c9092357/public_html/wp-content/themes/thegossip/functions.php on line 21

    The same error occurs on my own hosting when I perform the same migration.

    The website was working OK previously before the migration.

    The address is:

    http://www.footballedit.com/

    Can anyone help or point me in the right direction please?

    Steve.

Viewing 10 replies - 1 through 10 (of 10 total)
  • Hi Steve,

    Can you try uploading your files from a local backup instead of migrating files from host to host?

    Hi Amanda,

    Thanks for your reply.

    Do you mean from a WordPress backup performed from the dashboard?

    The development website was created by another developer and I am now trying to migrate it to the live domain, which is on another host.

    Currently there is no local install of the website, although I could attempt to transfer it from the current host to a local install.

    Steve.

    Looks like there’s an entry in your functions.php that’s trying to include a file that’s not present. What does line 21 say?

    Here is the section of code in the functions.php where the problem is:

    /////////////////////////////////////// Images in Widget Titles ///////////////////////////////////////
    
    if ( include( 'custom_widgets.php' ) ){
    add_action( "widgets_init", "load_custom_widgets" );
    }
    function load_custom_widgets() {
    unregister_widget( "WP_Widget_Text" );
    register_widget( "WP_Widget_Text_Custom" );
    }

    Line 21 is:

    if ( include( 'custom_widgets.php' ) ){

    The file custom_widgets.php does exist on the server in /wp-includes

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    And here is the error log of the most recent errors on the website:

    [08-Jan-2014 17:38:13 UTC] PHP Warning:  require(gp_incoptions.php): failed to open stream: No such file or directory in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/header.php on line 16
    [08-Jan-2014 17:38:13 UTC] PHP Warning:  require(gp_incoptions.php): failed to open stream: No such file or directory in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/header.php on line 16
    [08-Jan-2014 17:38:13 UTC] PHP Fatal error:  require(): Failed opening required 'gp_incoptions.php' (include_path='/home/wwwflywe/public_html/footballedit/wp-content/plugins/sabai/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/header.php on line 16
    [08-Jan-2014 17:43:42 UTC] PHP Warning:  include(custom_widgets.php): failed to open stream: No such file or directory in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/functions.php on line 21
    [08-Jan-2014 17:43:42 UTC] PHP Warning:  include(custom_widgets.php): failed to open stream: No such file or directory in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/functions.php on line 21
    [08-Jan-2014 17:43:42 UTC] PHP Warning:  include(): Failed opening 'custom_widgets.php' for inclusion (include_path='/home/wwwflywe/public_html/footballedit/wp-content/plugins/sabai/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/functions.php on line 21
    [08-Jan-2014 17:43:44 UTC] PHP Warning:  include(custom_widgets.php): failed to open stream: No such file or directory in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/functions.php on line 21
    [08-Jan-2014 17:43:44 UTC] PHP Warning:  include(custom_widgets.php): failed to open stream: No such file or directory in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/functions.php on line 21
    [08-Jan-2014 17:43:44 UTC] PHP Warning:  include(): Failed opening 'custom_widgets.php' for inclusion (include_path='/home/wwwflywe/public_html/footballedit/wp-content/plugins/sabai/lib:.:/usr/lib/php:/usr/local/lib/php') in /home/wwwflywe/public_html/footballedit/wp-content/themes/thegossip/functions.php on line 21
    [08-Jan-2014 19:39:19 UTC] PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 7680 bytes) in /data01/c9092357/public_html/wp-admin/includes/plugin.php on line 1605

    It seems that the paths are incorrect in a number of php files? So need to manually change these…

    The file custom_widgets.php does exist on the server in /wp-includes

    It wouldn’t, it’s not a native WordPress file, it’s part of your theme.

    Your theme The Gossip isn’t actually supported here since it’s a commercial product. However, try looking in your theme download archive for the file or maybe it’s a custom template developed by the client or a previous developer?

    Compare the original installation theme folder with the new install folder.

    Yoiks, just seen the big list of errors. Looks like a pretty barfed migration. Install this plugin on the original site:

    http://wordpress.org/plugins/wp-migrate-db/

    Export the DB after entering old/new details.

    Import the DB on the new site.

    And of course, make sure the file trees are the same.

    rsync -avz /local/path/ new_server:/remote/path FTW!

    I know!

    I used my usual method of migration of export/import the DB from cpanel and then using a search and replace php script to change paths.

    I’ll redo it using your method.

    Thanks for the help, i’ll keep you updated!

    I’ve tried all but rsync and still getting the same issues.

    I don’t have shell access to the server i’m migrating from as it is the previous developers server, only have ftp access.

    Would you have any other ideas??!

    I do 95% everything on the command line so if I don’t have shell access, once I’d stop whinging to myself I’d be firing up lftp

    Connect to the dev site with lftp and then:

    mirror --parallel=5 --use-pget-n=10

    You can be pretty certain you’ll get everything then.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘failed to open stream: No such file or directory’ is closed to new replies.