在Win2003 IIS6 NTFS下装PHP需要开放的权限

时间:2022-04-01 03:41:57

出处:http://www.php.net/manual/zh/install.windows.php

在Windows Server 2003/ IIS 6.x上安装PHP 5.x时请阅读以下文件. 让它工作起来的过程真是很有挫败感, 所以希望我的经历可以让其他人少走弯路.

在根据网络教程安装PHP 5前(这里有一篇很好的: http://www.peterguy.com/php/install_IIS6.html) 请阅读以下提示:
这些是我找到的可以安全工作的权限设置:NTFS权限(右键单击文件或文件夹, 选择属性, 打开安全页)
1) PHP安装目录 -> 你需要给NT用户:'Network Service' 读/运行 权限(如C:/PHP). 如果你在安装目录里有一个 tmp 或 session 目录, 你需要对这些目录给'Network Service'用户 读/运行 权限. *(你不需要对PHP安装文件给匿名Internet用户'IUSR_[name]'任何权限.
2) 你需要对实际的WWW根目录和网页 .php文件(如果你想应用到全部站点)或每一个站点的根目录和.php文件(如果是多个运行的站点)给匿名Internet用户'IUSR_[name]' 读/运行 权限
3) 对于IIS6.0控制台, 如果站点属性(右击某独立站点或网站根结点以应用到全部站点->选择属性) 在目录安全页->单击编辑, 如果你希望站点可以被匿名访问, 选中匿名访问的多选框并输入用户名:'IUSER_[name]' (IUSER_[name]根据你的服务器的用户设置而自定义)
4) *最重要的* 根据其他人提及的, 安装和设置PHP.INI时, 先不要打开任何扩展EXTENSIONS. 原因是如果某一个扩展extension出错, 错误提示框会弹出在远程桌面之外, 你将不能关闭那个对话框, 而你的PHP页面就会无限期挂起(出现这个问题后, 为了解决我几乎要疯了)
然后在你成功打开测试PHP页后, 再去把PHP.INI文件里的扩展extensions一次全部打开.
如果你有任何我没有提及的技巧,请发邮件给我. 再次声明, 我并不专业, 也在学习中.
现在你读完了这些, 打开我在顶部发的链接, 跟着教程完成一般的设置安装.

winterspan - AT - g m a i l . /C/O/M
19-May-2006 09:57
READ HERE If installing PHP 5.x on Windows Server 2003 / IIS 6.x ...
It was extremely frustrating getting this to work, so hopefully my struggle will allow others to do this the *easy* way.
BEFORE installing PHP 5 from a web tutorial (a good one found here: http://www.peterguy.com/php/install_IIS6.html)
You need to READ THESE TIPS:

 #Necessary Permissions For WinServer 2003 / IIS6.0#

These are the permission settings I found to work well with good security:
NTFS permissions (right-click file or folder, select preferences, go to security tab)
1) PHP Install folder -> You need to give NT account: 'Network Service' read/execute permissions on the 'php' install folder (e.g., C://PHP). If you have a TMP or SESSION folder within the main PHP folder, you need to give account 'Network Service' read/execute AND write access on those folders.  *(You DO NOT need to give the anonymous internet user account: 'IUSR_[name]' ANY permissions on the PHP INSTALL files themselves. )*
2) You DO need to give account: 'IUSR_name' Read/execute
permissions on the actual WWW root folder and web .php files (if you want to apply to all sites) or each websites WWW root and .php files if running multiple sites.
3) Within the IIS 6.0 console itself, in the website's preferences (right click on ind. site or 'websites' node to apply to all sites -> select preferences) on the
'Directory Security' tab -> click edit, and if you wish to allow anonymous access to your site, check the anonymous access box and be sure to enter account: 'IUSR_name'.
4) *MOST IMPORTANT*
As mentioned by a few others, install php and configure the php.ini WITH NO EXTENSIONS AT FIRST. The reason being if one of the extensions fail, the error dialog will pop up OUTSIDE of a terminal services window (remote desktop). So you will NOT BE ABLE to click on the error, and the websites php file you are trying to load in your browser will hang indefinately (after having this happen for 12 hours I almost went insane trying to figure out the problem) LOL.

Then when you have successfully loaded a test php page in the browser, go back to the php.ini file and add extensions in one at a time.
If YOU have any tips I haven't included, email me. Again,
I am not a professional, still a student in learning. :)
Now that you have read that, go back to the link I placed near the top, and follow his tutorial for general installation/setup.