主题: linux 上无法浏览服务器目录内容
作者: jacky82, 发布日期: 2013-05-21 13:23:26, 浏览数: 4944

4.1.7 版本

我在win7上apache

跑php 后台编辑器,浏览正常,但是上传到linux服务器上,浏览服务器功能无法进入目录查看图片。

请问应该怎么解决?

upload_json.php

//文件保存目录路径
$save_path = $php_path . '../../../upload/';
//文件保存目录URL
$save_url = $php_url . '../../../upload/';
 file_manager_json.php
//根目录路径,可以指定绝对路径,比如 /var/www/attached/
$root_path = $php_path . '../../../upload/';
//根目录URL,可以指定绝对路径,比如 http://www.yoursite.com/attached/
$root_url = $php_url . '../../../upload/';
请高手收指教
还有就是编辑器在火狐下面无法正常显示。
作者: Roddy, 发布日期: 2013-05-21 18:31:23
要么路径不对,要么没有权限查看。
回复
作者: jacky82, 发布日期: 2013-05-22 09:09:34
回复Roddy:应该不是路径问题,也不是权限问题,目录权限我已经设置为777了,可以看到编辑器自己建立的目录,但是不能进入目录查看里面的图片。请问有解决方法吗?
回复
作者: Roddy, 发布日期: 2013-05-22 17:03:23
回复jacky82:先把PHP的error_reporting错误全打开,看看报什么错误。http://www.php.net/manual/zh/function.error-reporting.php
回复
作者: jacky82, 发布日期: 2013-05-22 18:06:25
回复Roddy:貌似没看到有报错,我在win7下面用是正常的。但是传到linux上的apache就访问不了目录里的图片了。只能看到目录。点不进去。
回复
作者: Roddy, 发布日期: 2013-05-22 18:38:35
回复jacky82:用Chrome控制台或Firebug调试一下,看看file_manager_json.php返回什么,可以在浏览器直接打开这个PHP调试。
回复
作者: jacky82, 发布日期: 2013-05-23 11:53:43

回复Roddy:我直接打开提示这些信息

/home/www/www.xxxx.com/www/upload<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
<br />
<b>Warning</b>:  scandir() has been disabled for security reasons in <b>/home/www/www.xxxx.com/www/include/kindeditor/php/file_manager_json.php</b> on line <b>78</b><br />
{"moveup_dir_path":"","current_dir_path":"","current_url":"\/include\/kindeditor\/php\/..\/..\/..\/upload\/","total_count":471,"file_list":[{"is_dir":true,"h
回复
作者: Roddy, 发布日期: 2013-05-23 13:35:37
回复jacky82:PHP不能用scandir函数,难道是开启了safe_mode?
回复
作者: jacky82, 发布日期: 2013-05-23 18:39:34

回复Roddy:可以了,非常感谢!

VI编辑 /usr/local/php/etc/php.ini文件中,找到 disable_functions 后面的 scandir删除掉这个函数。

然后重启apache,就好了。

回复
发表新帖 发表回复