簡體   English   中英

在Linux服務器上使用plesk的PHP會話錯誤

[英]PHP Session Error using plesk on a linux server

我的朋友使用plesklinux server上托管一個網站。

他幾乎在每個頁面上都遇到404 error ,並且他得到的錯誤代碼粘貼在下面:(我不能發布兩個以上的鏈接,因此您會看到***而不是yaoihavenreborn.com

[Sun Mar 31 19:17:52 2013] [error] [client 69.158.139.233] PHP Warning: is_readable():
 open_basedir restriction in effect. File(/var/www/vhosts/***/httpdocs/wp-
content/plugins/content-progress/content-progress.php/content-progress-en_US.mo) is not 
within the allowed path(s): (/var/www/vhosts/***/httpdocs:.:/php:/tmp) in 
/var/www/vhosts/***/httpdocs/wp-includes/l10n.php on line 339, referer: http://***/whats-
new/

我們簽出了類似的文章,這些文章涉及糾正open_basedir錯誤,但是創建vhost並不能解決問題,而且我們根本不知道該怎么辦。

這是使用以下指示添加vhost后的error log的副本: http://www.bigsoft.co.uk/blog/index.php/2007/12/30/fixing-php-s-require-open_basedir-restri : http://www.bigsoft.co.uk/blog/index.php/2007/12/30/fixing-php-s-require-open_basedir-restri

[Mon Apr 01 00:53:47 2013] [error] [client 99.112.124.229] PHP Warning:  fopen(/var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/css/mce_modify.css): failed to open stream: Permission denied in /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/options_functions.php on line 1209, referer: http://***/forums/forum/yaoi-haven-reborn/
[Mon Apr 01 00:53:47 2013] [error] [client 99.112.124.229] PHP Warning:  fwrite() expects parameter 1 to be resource, boolean given in /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/options_functions.php on line 1210, referer: http://***/forums/forum/yaoi-haven-reborn/
[Mon Apr 01 00:53:47 2013] [error] [client 99.112.124.229] PHP Warning:  fclose() expects parameter 1 to be resource, boolean given in /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/options_functions.php on line 1211, referer: http://***/forums/forum/yaoi-haven-reborn/
[Mon Apr 01 00:53:47 2013] [error] [client 99.112.124.229] PHP Warning:  chmod(): Operation not permitted in /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/options_functions.php on line 1212, referer: http://***/forums/forum/yaoi-haven-reborn/
[Mon Apr 01 00:53:49 2013] [error] [client 67.1.158.170] PHP Warning:  fopen(/var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/css/mce_modify.css): failed to open stream: Permission denied in /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/options_functions.php on line 1209, referer: http://***/forums/topic/blah-blah-favorite-gamesmusic-and-making-friends3/
[Mon Apr 01 00:53:50 2013] [error] [client 108.29.88.87] PHP Warning:  chmod(): Operation not permitted in /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/options_functions.php on line 1212, referer: http://***/forums/topic/blah-blah-favorite-gamesmusic-and-making-friends3/

感謝您提供的所有幫助:)

您的www文件夾中的文件許可權設置不正確:您應該為www-data用戶(組)設置項目中可讀的文件和文件夾。

sudo chgrp -R www-data /var/www/ #set the usergroup for all files, directories in www folder
sudo chmod -R g+r /var/www # make all file/dir readeable by group
find /var/www/ -type d | xargs sudo chmod g+xs //make all dir executeable (and set the group rights inherited by newly created files, dirs in the future, so you dont need to repeat the permission settings when you will create new files.

如果服務器中有多個項目,並且僅對當前項目有問題,請在下面的命令中將/ var / www更改為項目的根目錄。

並且您應該設置可寫,哪些文件需要用php編寫:

sudo chmod g+w /var/www/vhosts/***/httpdocs/wp-content/plugins/ultimate-tinymce/css/mce_modify.css
//repeat this on all file need to be written by your webapp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM