2016-10-07 56 views
0

所有我與我的WordPress的一個權限問題鬥爭。 正如你可以看到WordPress的:奇怪的權限問題

ls -la wp-content/themes/impreza/ 
total 144 
drwxr-xr-x 9 root root 4096 Oct 7 16:49 . 
drwxr-xr-x 4 root root 4096 Oct 7 11:21 .. 
-rwxr-xr-x 1 root root 330 Oct 7 10:33 404.php 
-rwxr-xr-x 1 root root 340 Oct 7 10:33 archive.php 
-rwxr-xr-x 1 root root 339 Oct 7 10:33 author.php 
-rwxr-xr-x 1 root root 349 Oct 7 10:33 comments.php 
drwxr-xr-x 2 root root 4096 Oct 7 16:48 config 
drwxr-xr-x 2 root root 4096 Oct 7 10:33 css 
drwxr-xr-x 10 root root 4096 Oct 7 10:33 demo-import 
-rwxr-xr-x 1 root root 337 Oct 7 10:33 footer.php 
-rwxr-xr-x 1 root root 355 Oct 7 10:33 forum.php 
drwxr-xr-x 15 root root 4096 Oct 7 10:34 framework 
drwxr-xr-x 3 root root 4096 Oct 7 10:34 functions 
-rwxr-xr-x 1 root root 1105 Oct 7 10:33 functions.php 
-rwxr-xr-x 1 root root 337 Oct 7 10:33 header.php 
-rwxr-xr-x 1 root root 359 Oct 7 10:33 header-shop.php 
-rwxr-xr-x 1 root root 361 Oct 7 10:33 index.php 
drwxr-xr-x 2 root root 4096 Oct 7 10:33 js 
-rwxr-xr-x 1 root root 325 Oct 7 10:33 page.php 
-rwxr-xr-x 1 root root 18970 Oct 7 10:33 screenshot.png 
-rwxr-xr-x 1 root root 388 Oct 7 10:33 searchform.php 
-rwxr-xr-x 1 root root 344 Oct 7 10:33 search.php 
-rwxr-xr-x 1 root root 645 Oct 7 10:33 single.php 
-rwxr-xr-x 1 root root 365 Oct 7 10:33 single-us_portfolio.php 
-rwxr-xr-x 1 root root 288 Oct 7 10:33 style.css 
-rwxr-xr-x 1 root root 15056 Oct 7 16:49 us-logo.png 
drwxr-xr-x 3 root root 4096 Oct 7 10:34 vendor 
-rwxr-xr-x 1 root root 4341 Oct 7 10:33 wpml-config.xml 
在我的主題

夾中的一切是等於權限,但我不能訪問他們所有。例如

不可見 - http://www.aniabuchi.com/wp-content/themes/impreza/us-logo.png

可見 - http://www.aniabuchi.com/wp-content/themes/impreza/screenshot.png

本身活性染料的主題,但是當我嘗試激活插件也說「請調整文件權限允許插件安裝」 。 這是我第二WordPress安裝和我所做的唯一的區別是隻使用一個WP-contents的文件夾

/* Default value for some constants if they have not yet been set 
    by the host-specific config files */ 
if (!defined('ABSPATH')) 
    define('ABSPATH', '/var/www/aniabuchi/'); 
if (!defined('WP_CORE_UPDATE')) 
    define('WP_CORE_UPDATE', false); 
    define('DB_HOST', 'localhost'); 
if (!defined('WP_CONTENT_DIR') && !defined('DONT_SET_WP_CONTENT_DIR')) 
    define('WP_CONTENT_DIR', '/var/www/aniabuchi/wp-content'); 
+1

或許你可以問你的問題上http://wordpress.stackexchange.com/ – baudsp

回答

0
  1. 嘗試使圖像777,看看你是否可以訪問它們。

  2. for plugin,你應該檢查你的「wp-content/plugins」文件夾權限,而不是主題。

+0

我已經做到這一點:),仍然有問題。另外重新啓動Apache和MySQL服務 –

0

您需要確保分配給文件和目錄的所有者是Web服務器的用戶,否則WordPress會失敗,所有的插件安裝或更新,無論文件/文件夾的權限。在ubuntu/debian上,通常是www-data,而在centos/rhel/fedora上則是apache。

+0

是的我知道,我的其他網站運行在同一臺計算機上,但具有不同的MySQL數據庫和不同的文件夾。它具有相同的用戶權限,一切都由root用戶擁有:root。唯一的區別是,其他網站有不同的位置WP_CONTENT_DIR不進入ABSPATH,我不認爲這是問題:( 爲什麼一個圖片是可見的,另一個不只是點擊鏈接,看看你自己 –

+0

用戶權限一直是WP的問題,幾乎所有像這樣的問題都通過擁有者/文件權限解決,不確定777是否需要用於圖像,但應該只需要644。 – Stephan

0

試試這個,檢查 - 它可能做的伎倆:

# chmod 755 -R <path_to_your_webroot_folder> 
# chown root:root -R <path_to_your_webroot_folder>