2016-09-17 121 views
0

使用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個整小時在這個上,而且我很有智慧。將不勝感激任何幫助。謝謝。

+1

對我來說看起來像是一個斜槓問題。注意,找不到的文件在前後方向都有斜線?如果我嘗試在記事本++中打開'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

回答

0

這樣做解決了我的問題如下:

  1. 保存WP-站點文件夾/刪除WAMP/reintall WAMP內WAMP
  2. 建立在phpMyAdmin /導入SQL數據庫

  3. 地方WP-站點文件夾數據庫備份

    =>確切相同的錯誤=>問題是內部WP-站點文件夾

  4. 用乾淨的安裝替換核心wordpress文件/文件夾,保留之前的wp-content文件夾和wp-config.php

PRESTO。有時候最好不要理解問題,並從頭開始。

相關問題