最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - Failed to open streamno such file or directory

programmeradmin4浏览0评论

Server upgrading Friday, which will kill my existing WP 3.1 blog. So I’m installing 4.7.3 fresh in new subdirectory of existing WP 3.1 domain/site AND using the same database. Domain is a subweb. Server is running PHP 5.3. (New one will run 5.6) Once working, I’ll point the domain at the new directory. (Not sure whether subweb/shared db might affect this?)

I did mod the wp-config file with db info and memory use limits. Other than that, the entire install is fresh out of the box. No theme files here other than those included with 4.7.3 (although the old blog is running Thesis 1.8). No plugins other than stock akismet.

Got the following errors:

Warning: require_once(/users/domain/htdocs/directory/new subdirectory/wp-load.php) [function.require-once]: failed to open stream: No such file or directory in /users/domain/htdocs/directory/new subdirectory/wp-admin/install.php on line 36

Fatal error: require_once() [function.require]: Failed opening required ‘/users/domain/htdocs/directory/new subdirectory/wp-load.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /users/domain/htdocs/directory/new subdirectory/wp-admin/install.php on line 36

Looking at the newly installed subdirectory, I saw ONLY folders:

wp-admin
wp-content
wp-includes

Next I tried uploading all files again. Same thing. So I selected the following files (without also selecting the above-named directories) and uploaded:

index.php
license.txt
readme.html
wp-activate.php
wp-blog-header.php
wp-comments-post.php
wp-config.php
wp-cron.php
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php

And I get a nearly identical error msg:

Warning: require(/users/domain/htdocs/directory/subdirectory/wp-includes/load.php) [function.require]: failed to open stream: No such file or directory in /users/domain/htdocs/directory/subdirectory/wp-settings.php on line 19

Fatal error: require() [function.require]: Failed opening required ‘/users/domain/htdocs/directory/subdirectory/wp-includes/load.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /users/domain/htdocs/directory/subdirectory/wp-settings.php on line 19

No idea what's going on here, hoping to learn how to fix it.

Any help appreciated!

Server upgrading Friday, which will kill my existing WP 3.1 blog. So I’m installing 4.7.3 fresh in new subdirectory of existing WP 3.1 domain/site AND using the same database. Domain is a subweb. Server is running PHP 5.3. (New one will run 5.6) Once working, I’ll point the domain at the new directory. (Not sure whether subweb/shared db might affect this?)

I did mod the wp-config file with db info and memory use limits. Other than that, the entire install is fresh out of the box. No theme files here other than those included with 4.7.3 (although the old blog is running Thesis 1.8). No plugins other than stock akismet.

Got the following errors:

Warning: require_once(/users/domain/htdocs/directory/new subdirectory/wp-load.php) [function.require-once]: failed to open stream: No such file or directory in /users/domain/htdocs/directory/new subdirectory/wp-admin/install.php on line 36

Fatal error: require_once() [function.require]: Failed opening required ‘/users/domain/htdocs/directory/new subdirectory/wp-load.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /users/domain/htdocs/directory/new subdirectory/wp-admin/install.php on line 36

Looking at the newly installed subdirectory, I saw ONLY folders:

wp-admin
wp-content
wp-includes

Next I tried uploading all files again. Same thing. So I selected the following files (without also selecting the above-named directories) and uploaded:

index.php
license.txt
readme.html
wp-activate.php
wp-blog-header.php
wp-comments-post.php
wp-config.php
wp-cron.php
wp-links-opml.php
wp-load.php
wp-login.php
wp-mail.php
wp-settings.php
wp-signup.php
wp-trackback.php
xmlrpc.php

And I get a nearly identical error msg:

Warning: require(/users/domain/htdocs/directory/subdirectory/wp-includes/load.php) [function.require]: failed to open stream: No such file or directory in /users/domain/htdocs/directory/subdirectory/wp-settings.php on line 19

Fatal error: require() [function.require]: Failed opening required ‘/users/domain/htdocs/directory/subdirectory/wp-includes/load.php’ (include_path=’.:/usr/share/php:/usr/share/pear’) in /users/domain/htdocs/directory/subdirectory/wp-settings.php on line 19

No idea what's going on here, hoping to learn how to fix it.

Any help appreciated!

Share Improve this question edited Mar 28, 2017 at 23:33 David Lee 3,9413 gold badges15 silver badges20 bronze badges asked Mar 28, 2017 at 21:25 jomarjomar 11 gold badge1 silver badge2 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 1

It could be 2 things

Most like it's your file permissions. It is probably that your apache isn't able to open the files set files to 0644 and directories 0755.

The other problem could be your php version. Since you are upgrading to a new server, why not get the php in version 7? php 5.6 hit end of life 2 months ago.

I had the same problem. Apparently the filename referenced in the "require" code is in the wrong case. I just had to use the right case and it worked.

So instead of:

require_once "myFile.php";

I used:

require_once "myfile.php";
发布评论

评论列表(0)

  1. 暂无评论