How to fix WordPress Automatic Update Error called ‘[function.require]: failed to open stream: No such file or directory in’ & another error called ‘Fatal error: require() [function.require]: Failed opening required’, ‘(include_path=’.:/usr/local/php-5.3.27/share/pear’)’.

When WordPress.Org releases new update to it’s WordPress standalone CMS (Content Management System) for that you may have set your website to get your installation updated automatically or you may like to do it your self at your preferred time. What ever case may be.

 
But because of server load on part of your web host you may get error something like this with screwed up blank website with following error printed on screen:

 

Warning: require(/nfs/domains/your-domain-name.com/html/wp-includes/session.php) [function.require]: failed to open stream: No such file or directory in /nfs/domains/your-domain-name.com/html/wp-settings.php on line 122

Fatal error: require() [function.require]: Failed opening required '/nfs/domains/your-domain-name.com/html/wp-includes/session.php' (include_path='.:/usr/local/php-5.3.27/share/pear') in /nfs/domains/your-domain-name.com/html/wp-settings.php on line 122

 

Real cause of above errors:

 
Above mentioned errors are generated because of interrupted WordPress updates mostly because of heavy load on your web host’s online server. As update fails all files mismatch with consistent version number so some old source files remains as it is & only remaining few get updated with new version. So it is problem of source code version consistency.

 
How to fix this:

 
Error 01: [function.require]: failed to open stream: No such file or directory in

 
Error 02: Fatal error: require() [function.require]: Failed opening required & (include_path=’.:/usr/local/php-5.3.27/share/pear’)

 
There is solution for above two errors & here is how to fix this,

 
Step 01: First & foremost backup your installation & database

 

Note: Now check on your Server Home / domains / your-domain-name.com / html / wp-content / upgrade & delete if any existing files in this folder through FTP

 
Step 02: Download WordPress update in zip file from wordpress.org download section

 
Step 03: Unzip that WordPress update zip file on your desktop

 
Step 04: Now sign in to your server to the root folder of your preferred domain

 
Step 05: Now delete the old wp-includes and wp-admin directories on your web host (through your FTP or shell access).

 
Step 06: Using FTP or your shell access, upload the new wp-includes and wp-admin directories from downloaded unpacked archive to your web host, in place of the previously deleted directories.

 
Step 07: (Precaution) Do not delete or replace wp-content folder on online server on your web host

 
Step 08: Now upload all remaining new loose files from the root directory of the new version to your existing WordPress root directory on online server.

 
Step 09: Now after completing upload go to you domain’s web address & see if website has been started to work as before.

 
I hope your website will start to function as normal as before.

 
Hope it helps.

 
Thanks & Regards
Mandar Apte

6 thoughts on “How to fix WordPress Automatic Update Error called ‘[function.require]: failed to open stream: No such file or directory in’ & another error called ‘Fatal error: require() [function.require]: Failed opening required’, ‘(include_path=’.:/usr/local/php-5.3.27/share/pear’)’.

  1. Hi
    I followed your explanation above, but now when entering in WP a lot of features are gone. The plugins are mising. And I can’t even uninstall the ones that are not working. So what would be my next step? Do I have to restore from my back-up file? and how do I do that?
    I really hope you can help me out. Thank you very much in advance. :-)

  2. Thank you, it worked like a charm.@Nina,I dont know how your plugins got missing.Here is how I did it.I hate uploading or downloading files through FTP client,so I logged into my server, compressed the wp-admin and wp-includes folders,and re-named the ZIP files.

    After downloading the new wordpress ZIP file to my desktop,I compressed the wp-admin and wp-includes folders,then uploaded them on my site.I then uncompressed the ZIP files….and BAM my site came alive with no issues or errors.Wordpress compelled me to upgrade to the newest version,I complied and my website was working with all plugins and Ads intact.I hope this helps.

    The problem with FTP clients is that you are more likely to miss files or mix up things during the transfer,and even upload to the wrong folder.It also takes longer.Thats why I hate FTP clients.Its much quicker and error-proof to compress folders and upload directly onto the server, and vice-versa.

  3. hi there,
    thank you for your hints! I could’t find the update files, so I replace the damaged files with undamaged files from another WordPress installation.
    And it worked fine!

    cheers

Leave a Reply

Your email address will not be published. Required fields are marked *