免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 3746 | 回复: 5
打印 上一主题 下一主题

include_path目录权限到底如何设置? [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-11-22 21:25 |只看该作者 |倒序浏览
当前用户a
在/home/a下面建了个测试的目录test

pear是sudo apt-get install php-pear自动装好到/usr/share/php下的

/etc/php5/apache2/php.ini 里
include_path已经改为
include_path = ".:/usr/share/php"
apache2重启
这样sudo ln -s test目录到/var/www
基本php可用,但是用pear包的时候,就提示找不到pear用到的文件

于是照提示,只接把那个/usr/share/php
sudo chown -R a:a,可到是能用pear了

不过感觉总是不应该这么设置属主为a,保持原来的root才对

不知道到底如何才对???

翻贴子看到说chmod 777 的,那岂不是更不安全?~

哪位能解释一下?~

需要的就是我不论哪个用户写的,都可以在include_path里找到pear才对,而不是需要chown到用户名

谢谢~~

论坛徽章:
0
2 [报告]
发表于 2006-11-22 22:00 |只看该作者
0444

论坛徽章:
0
3 [报告]
发表于 2006-11-23 08:16 |只看该作者
0664

论坛徽章:
0
4 [报告]
发表于 2006-11-23 13:21 |只看该作者
好像都不大行啊,chown -R改回root
再chmod -R 0664(0444) /usr/share/php

还是出错~
====================
Warning: include_once(Benchmark/Timer.php) [function.include-once]: failed to open stream: No such file or directory in /home//zend/showTimer.php on line 2

Warning: include_once() [function.include]: Failed opening 'Benchmark/Timer.php' for inclusion (include_path='.:/usr/share/php') in /home/zend/showTimer.php on line 2

Fatal error: Class 'Benchmark_Timer' not found in /home/zend/showTimer.php on line 4

=======================
书上照抄的代码
<?php
include_once "Benchmark/Timer.php";

$timer1 = new Benchmark_Timer();
$timer2 = new Benchmark_Timer();

$timer1->start();
//$time->setMarker('Mark 1');
echo "Helo,World<br>";
sleep(1);
$timer2->start();
sleep(1);

$timer1->setMarker("mark 1");
echo "timer1 's time from start to mark:_";
echo $timer1->timeElapsed("Start","mark 1");
echo "---";
sleep(1);
echo "<br>1 timers run";

$timer1->stop();
$timer1->display();

echo "<br>2 timers run";

$timer2->stop();
$timer2->display();



?>

[ 本帖最后由 wshd 于 2006-11-23 15:14 编辑 ]

论坛徽章:
1
技术图书徽章
日期:2013-12-05 23:25:45
5 [报告]
发表于 2006-11-23 13:48 |只看该作者
只要你的php运行宿主有权读即可。

论坛徽章:
0
6 [报告]
发表于 2006-11-23 14:46 |只看该作者
drwxr-xr-x   12 root root  4.0K 2006-11-23 21:16 php

这样是不是有权限读啊?~
$ ll /usr/share/php
总用量 108K
drwxr-xr-x  2 root root 4.0K 2006-11-23 21:14 Archive
drwxr-xr-x  2 root root 4.0K 2006-11-23 21:16 Benchmark
drwxr-xr-x  2 root root 4.0K 2006-11-23 21:14 Console
drwxr-xr-x  3 root root 4.0K 2006-11-23 21:14 data
drwxr-xr-x  3 root root 4.0K 2006-11-23 21:14 doc
drwxr-xr-x  3 root root 4.0K 2006-11-23 21:16 docs
drwxr-xr-x  2 root root 4.0K 2006-11-23 21:14 OS
drwxr-xr-x 11 root root 4.0K 2006-11-23 21:14 PEAR
-rw-r--r--  1 root root  15K 2006-11-02 20:49 pearcmd.php
-rw-r--r--  1 root root  34K 2006-11-02 20:49 PEAR.php
-rw-r--r--  1 root root 1.8K 2006-11-02 20:49 peclcmd.php
-rw-r--r--  1 root root  19K 2006-11-02 20:49 System.php

错误还是那样~~
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP