我的apache+php 安装在C:\Program Files\LocalHost目录下,主目录doc_root也在这个目录下面,我已经配置好在主根目录,能运行各种php脚本没有问题。但是,现在我想配置用户目录,使得用户目录也能执行php脚本。我的配置方法是:
文件:php.ini
user_dir =D:\Downloads\User\Userdir
(并在userdir下建立sisy目录,作为单个的用户目录,并在下面建立了两个文件:index.php、test.htm)
文件:httpd.conf
因为主目录已经配置成功,运行正常,此处略。
文件:httpd-userdir.conf
UserDir "D:/Downloads/User/Userdir"
Options Indexes FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
但是,我打开http://localhost:86/~sisy/test.htm http://localhost:86/~sisy/test.htm 正常,打开http://localhost:86/~sisy/ http://localhost:86/~sisy/ 失败,提示找不到网页。出错时日志如下:
error.log
[Tue Aug 25 18:01:28 2009] [notice] Child 740: Exit event signaled. Child process is ending.
[Tue Aug 25 18:01:29 2009] [notice] Child 740: Released the start mutex
[Tue Aug 25 18:01:30 2009] [notice] Child 740: All worker threads have exited.
[Tue Aug 25 18:01:30 2009] [notice] Child 740: Child process is exiting
[Tue Aug 25 18:01:30 2009] [notice] Parent: Child process exited successfully.
[Tue Aug 25 18:01:35 2009] [notice] Apache/2.2.11 (Win32) configured -- resuming normal operations
[Tue Aug 25 18:01:35 2009] [notice] Server built: Dec 10 2008 00:10:06
[Tue Aug 25 18:01:35 2009] [notice] Parent: Created child process 420
[Tue Aug 25 18:01:35 2009] [notice] Child 420: Child process is running
[Tue Aug 25 18:01:35 2009] [notice] Child 420: Acquired the start mutex.
[Tue Aug 25 18:01:35 2009] [notice] Child 420: Starting 64 worker threads.
[Tue Aug 25 18:01:35 2009] [notice] Child 420: Starting thread to listen on port 86.
access.log
127.0.0.1 - - [25/Aug/2009:18:01:38 +0800] "GET /~sisy/test.htm HTTP/1.1" 200 17
127.0.0.1 - - [25/Aug/2009:18:01:45 +0800] "GET /~sisy/ HTTP/1.1" 404 25
127.0.0.1 - - [25/Aug/2009:18:02:04 +0800] "GET /~sisy/ HTTP/1.1" 404 25
127.0.0.1 - - [25/Aug/2009:18:19:30 +0800] "GET /~sisy/ HTTP/1.1" 404 25
127.0.0.1 - - [25/Aug/2009:18:21:43 +0800] "GET /~sisy/ HTTP/1.1" 404 25
不知道如何应该如何配置.conf文件和php.ini,才能使得可以在用户目录中运行php脚本?
[ 本帖最后由 yt717 于 2009-8-25 18:28 编辑 ]
本篇文章来源于PHP论坛 文章地址:http://bbs.php.cn/thread-37486-1-1.html http://bbs.php.cn/thread-37486-1-1.html