Beginner's Guide for WordPress / Start your WordPress Blog in minutes

How to Fix the WordPress Failed to Open Stream Error

Are you seeing the ‘failed to open stream’ error in WordPress? This error usually points out the location of the scripts where the error has occurred. However, it is quite difficult for beginner users to understand it. In this article, we will show you how to easily fix the WordPress failed to open stream error.

Failed to open stream error in WordPress

Why Failed to Open Stream Error Occurs?

Before we try to fix the error, it would be helpful to understand what causes the ‘Failed to open stream’ error in WordPress.

This error occurs when WordPress is unable to load the file mentioned in website code. When this error occurs, sometimes WordPress will continue loading the site and only show a warning message, while other times WordPress will show a fatal error and will not load anything else.

The message phrasing will be different depending on where the error occurs in the code and the reason for failure. It will also give you clues about what needs to be fixed.

Typically, this message would look something like this:

Warning: require(/home/website/wp-includes/load.php): failed to open stream: No such file or directory in /home/website/wp-settings.php on line 19 

Fatal error: require(): Failed opening required ‘/home/website/wp-includes/load.php’ (include_path=’.:/usr/share/php/:/usr/share/php5/’) in /home/website/wp-settings.php on line 19

Here is another example:

Last Error: 2018-04-04 14:52:13: (2) HTTP Error: Unable to connect: ‘fopen(compress.zlib://https://www.googleapis.com/analytics/v3/management/accounts/~all/webproperties/~all/profiles?start-index=1): failed to open stream: operation failed’

Having said that, let’s take a look at how to troubleshoot and fix ‘failed to open stream’ error in WordPress.

Fixing Failed to Open Stream Error in WordPress

As we mentioned earlier, the error can be caused by a variety of reasons and the error message will be different depending on the cause and location of the file that’s causing the error.

In each instance, failed to open stream phrase would be followed by a reason. For example, permission denied, no such file or directory, operation failed, and more.

Now if your error message contains ‘no such file or directory’, then you need to look in the code to figure out which file is mentioned at that particular line.

If it is a plugin or theme file, then this means that the plugin or theme files were either deleted or not installed correctly. Simply deactivate and reinstall the theme / plugin in question to fix the error.

However, it is also possible that WordPress is unable to locate the files because of a missing .htaccess file in your root folder. In that case, you need to go to Settings » Permalinks page in your WordPress admin and just click on the ‘Save changes’ button to regenerate the .htaccess file.

Regenerate htaccess file in WordPress

If the error message is followed by ‘Permission denied’, then this means that WordPress does not have the right permission to access the file or directory referenced in the code.

To fix this, you need to check WordPress files and directory permissions and correct them if needed.

Lastly, some WordPress plugins load scripts from third-party sources like Google Analytics, Facebook APIs, Google Maps, and other third-party APIs.

Some of these APIs may require authentication or may have changed the way developers can access them. A failure to authenticate or incorrect access method will result in WordPress failing to open the required files.

To fix this, you will need to contact the plugin author for support. They will be able to help you fix the error.

If none of these tips help you resolve the issue, then follow the steps mentioned in our WordPress troubleshooting guide. This step by step guide will help you pinpoint the issue, so you can easily find the solution.

We hope this article helped you fix the WordPress ‘failed to open stream’ error. You may also want to bookmark our list of the most common WordPress errors and how to fix them.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. See how WPBeginner is funded, why it matters, and how you can support us.

The Ultimate WordPress Toolkit

Get FREE access to our toolkit – a collection of WordPress related products and resources that every professional should have!

Reader Interactions

16 CommentsLeave a Reply

  1. when i open error file in file manager then show error:-
    PHP Warning: Unknown: failed to open stream: Permission denied in Unknown on line 0

    PHP Fatal error: Unknown: Failed opening required ‘/home/printwow/public_html/site/index.php’
    (include_path=’.:/opt/alt/php54/usr/share/pear:/opt/alt/php54/usr/share/php’) in Unknown on line 0

    please help

  2. Please Help Me

    [15-Jun-2019 07:05:54 UTC] PHP Fatal error: require(): Failed opening required ‘/public_html/CMS/wp-includes/post-thumbnail-template.php’ (include_path=’.:/opt/alt/php70/usr/share/pear’) in /public_html/CMS/wp-settings.php on line 175

  3. Please help:

    Fatal error: require(): Failed opening required ‘/home/content/01/14040901/html/wp-blog-header.php’ (include_path=’.:/usr/local/php5_6/lib/php’) in /home/content/01/14040901/html/index.php on line 30

    how do i fix it? and what could be the probable cause of it?

  4. Please help me :

    Fatal error: require(): Failed opening required ‘/wp-includes/post.php’ (include_path=’.:/opt/cpanel/ea-php56/root/usr/share/pear’) in /public_html/wp-settings.php on line 178

  5. *Please Help*
    Fatal error: require_once(): Failed opening required ‘/public_html/wp-content/plugins/amp/includes/widgets/class-amp-widget-media-video.php’ (include_path=’.:/opt/php56/lib/php’)
    What do i do? I am not able to access my dashboard as well my site

  6. Three of my WP sites are hosted on the same hosting. All of them are giving the same error:

    Warning: require(/home/selfsbsr/public_html/pulse/wp-includes/post.php): failed to open stream: Permission denied in /home/selfsbsr/public_html/pulse/wp-settings.php on line 166

    Warning: require(/home/selfsbsr/public_html/pulse/wp-includes/post.php): failed to open stream: Permission denied in /home/selfsbsr/public_html/pulse/wp-settings.php on line 166

    Fatal error: require(): Failed opening required ‘/home/selfsbsr/public_html/pulse/wp-includes/post.php’ (include_path=’.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php’) in /home/selfsbsr/public_html/pulse/wp-settings.php on line 166

    Note that these three sites are single sites and NOT part of Multisite Network. They do NOT share databases or directories.
    All they have in common is the host.
    I’ve tried to resolve this by resetting permissions of all the files and directories, disabling plugins by renaming folders of each of em, disabling theme by renaming its folder. I’ve checked the htaccess file. Nothing is out of the ordinary. And yet, I can’t do anything bring it back up.
    What should be the probable cause?

Leave A Reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.