使用WAMP设置(Wordpress)本地网站。出于安全原因,在phpmyadmin中,创建了一个新用户并删除了用户根。新用户应该拥有全局权限,但没有。PHP/SQL - 无法打开流:没有此类文件或目录
以下帖子用于重新创建用户根目录deleted-mysql-root-user-using-phpmyadmin-how-to-restore。它的工作部分(即重新创建的根用户,具有全局特权,但仍不能创建新数据库,如“创建数据库:文档;无权限”所示)。但现在网站被打破。我得走了到localhost/mywebsite如果出现以下错误:
Warning: require(C:\wamp64\www\wordpress1\wordpress/wp-includes/session.php): failed to open stream: No such file or directory in C:\wamp64\www\wordpress1\wordpress\wp-settings.php on line 150
Call Stack
# Time Memory Function Location
1 0.0000 236160 {main}() ...\index.php:0
2 0.0025 239304 require('C:\wamp64\www\wordpress1\wordpress\wp-blog-header.php') ...\index.php:17
3 0.0025 259856 require_once('C:\wamp64\www\wordpress1\wordpress\wp-load.php') ...\wp-blog-header.php:13
4 0.0050 271784 require_once('C:\wamp64\www\wordpress1\wordpress\wp-config.php') ...\wp-load.php:39
5 0.0075 403592 require_once('C:\wamp64\www\wordpress1\wordpress\wp-settings.php') ...\wp-config.php:92
Fatal error: require(): Failed opening required 'C:\wamp64\www\wordpress1\wordpress/wp-includes/session.php' (include_path='.;C:\php\pear') in C:\wamp64\www\wordpress1\wordpress\wp-settings.php on line 150
Call Stack
# Time Memory Function Location
1 0.0000 236160 {main}() ...\index.php:0
2 0.0025 239304 require('C:\wamp64\www\wordpress1\wordpress\wp-blog-header.php') ...\index.php:17
3 0.0025 259856 require_once('C:\wamp64\www\wordpress1\wordpress\wp-load.php') ...\wp-blog-header.php:13
4 0.0050 271784 require_once('C:\wamp64\www\wordpress1\wordpress\wp-config.php') ...\wp-load.php:39
5 0.0075 403592 require_once('C:\wamp64\www\wordpress1\wordpress\wp-settings.php') ...\wp-config.php:92
所有文件存在。 我认为问题是服务器无法访问文件或数据库。以下问题可能会对我的问题有所帮助:php-failed-to-open-stream-no-such-file-or-directory/36577021。但我不明白,提供接受答案的4点说明 - 见下文:
/*To check under what user the server is running you can use posix_getpwuid :*/
$user = posix_getpwuid(posix_geteuid());
var_dump($user);
我该怎么办呢?
-- To find out the permissions on the file, type the following command in the terminal:
ls -l <C:/wamp64/www/wordpress1/wordpress>
并没有为我工作。按下Enter键后在终端中输入它会产生一个箭头。
我已经花了12个整小时在这个上,而且我很有智慧。将不胜感激任何帮助。谢谢。
对我来说看起来像是一个斜杠问题。注意,找不到的文件在前后方向都有斜线?如果我尝试在记事本++中打开'c:\ xampp2 \ htdocs \ snippets/matrix.html',它会在'C:\ xampp2 \ htdocs \ snippets'中获取文件,并且失败,并显示消息“snippets/matrix.html文件名无效“。另一方面,如果尝试打开'c:\ xampp2 \ htdocs \ snippets \ matrix.html',那很好。相反,'c:/ xampp2/htdocs/snippets/matrix.html'会失败并显示“文件未找到”类型的消息。 – enhzflep