PHP初学者的问题 (100分)

  • 主题发起人 mycwcgr_bak
  • 开始时间
M

mycwcgr_bak

Unregistered / Unconfirmed
GUEST, unregistred user!
我在Windows 98机器上安装了Apache 1.3.x ,并在c:/php/中安装了Php 4.0作为学习用
然后编辑httpd.conf文件加上了
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"
但是我在IE中打开http://cw/3_good.php (注意:cw是我机器名)
出现
HTTP 错误 403
403.1 禁止:禁止执行访问
如果从并不允许执行程序的目录中执行 CGI、ISAPI 或其他执行程序就可能引起此错误。
如果问题依然存在,请与 Web 服务器的管理员联系。
如果我用http://cw/cgi-bin/3_good.php
出现
Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.
For more information as to why this behaviour exists, see the manual page for CGI security.
For more information about changing this behaviour or re-enabling this webserver, consult the installation file that came with this distribution, or visit the manual page.
请问如果解决!
另外,再请教
cgi-bin目录下是放什么文件的?PHP文件是否必须放在这个目录下!
 
先看看 htm能不能正常访问,你的配置没什么问题
可以试试这么配置:
LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php

-----
http://www.8421.org
 
Apache没用过,不过用IIS(win2000)或PWS(win98)作WEB服务,配PHP,
我一直用得顺当。
 
PHP+PWS挺好的呀 干嘛不用?
 
这是我的经验,win2000+apache+php!
>>cgi-bin目录下是放什么文件的?PHP文件是否必须放在这个目录下!
默认的目录不是这个,我也忘记了,httpd.conf里有目录的,我手头没有apache没法查了。
可以改的,你自己找找。
apache+mysql+php基本配置:
1:下载php,mysql,apache.装上
2: 配置apache的httpd.conf文件方法:
1,要支持php4.需把httpd.conf中的下面这些行的"#"去掉
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
2,在httpd.conf的任何地方加上下面这些:
action application/x-httpd-php "/php/php.exe"
3,在httpd.conf中的<IfModule mod_dir.c>下加上:
directoryindex index.php
directoryindex index.htm
3: 配置php的php.ini文件:
1,把php.ini.*文件改为php.ini;
2,再把php.ini中的autosession值改为1;
3,把php.ini中的session.save_path = /tmp变为session.save_path=./tmp
ok!!!
 
我在万网申请的主机,PHP文件不放在cgi-bin目录也能执行!
cgi-bin目录是不是放能在服务器上执行的.exe,.cgi等程序的?
 
接受答案了.
 
顶部