1.cd dir/ 提示无权限
sudo cd dir/ 提示不可以command not found
解决:
:> sudo su
:> cd dir/
2.php.ini加入open_basedir导致访问文件夹受限,弹出错误:
Warning: is_dir() [function.is-dir]: open_basedir restriction in effect. File(/base) is not within the allowed path(s):
解决办法是根据phpinfo();来查出Loaded Configuration File(php.ini的位置),然后把php.ini中的open_base_dir注释掉(加;)或都再加上要求访问的目录.
open_basedir可将用户访问文件的活动范围限制在指定的区域,通常是其家目录的路径,也
可用符号”.”来代表当前目录。注意用open_basedir指定的限制实际上是前缀,而不是目录名。
举例来说: 若”open_basedir = /dir/user”, 那么目录 “/dir/user” 和 “/dir/user1″都是
可以访问的。所以如果要将访问限制在仅为指定的目录,请用斜线结束路径名。例如设置成:
“open_basedir = /dir/user/”
参考:
1.http://ubuntuforums.org/showthread.php?t=319229
2.https://help.ubuntu.com/community/RootSudo
3.