在这个文件的尾部加:#<VirtualHost _default_:*>
#</VirtualHost>
Alias /temp/ "c:/wwwroot/temp/"
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"
自己在自己的机器上做相应的改动!
#</VirtualHost>
Alias /temp/ "c:/wwwroot/temp/"
ScriptAlias /php/ "c:/php/"
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"
自己在自己的机器上做相应的改动!
ScriptAlias /php4/ "D:/ApacheWebServer/htdocs/"
是不是因为你的根目录和设置虚拟目录php4有冲突?
应该指向php的执行文件夹
首先,删除上面几种做法的配置;然后在httpd.conf中加入下面一段:
LoadModule php4_module c:/php/sapi/php4apache.dll
<FilesMatch ".*.(php4|php3|php|phtml)$">
ForceType application/x-httpd-php
</FilesMatch>
说明一点:(路径可以按照自己的设置更改,需php4版本)
配置成功慧显示这样的提示Apache/1.3.XX (Win32) PHP/4.0.XXX running...
如果有问题可以联系我。
php4.03和php4.04的配置似乎不一样。。
最要重的看说明,那几个英文很简单的。。:)
看看吧:
ScriptAlias /php/ "c:/php/"AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
AddType application/x-httpd-php .php4
AddType application/x-httpd-php .phtml
Action application/x-httpd-php "/php/php.exe"
Alias /web/ "d:/web/"这些都放在此文件的最后就行了。
虚拟目录为激活的php.exe 在C盘的根目录下的php目录中。