看到源码是因为你的apache不能解析php代码。
修改apache/conf/httpd.conf,添加下面的内容: ScriptAlias /php/ "E:/php/" //你本机的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" 至于文件存放目录,如果你不想放在htdocs下,只要把apache/conf/httpd.conf中的DocumentRoot改成你放php文件的目录即可。如:
DocumentRoot "E:/webroot"关于虚拟目录的设置,可以参考apache/conf/httpd.conf中的设置,照样改一下就可以了。如下:#<VirtualHost *>
# ServerAdmin [email protected]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>配置好后将前面的注释符号(#)删除就可以了。不过你的情况应该还不需要使用虚拟目录。
修改apache/conf/httpd.conf,添加下面的内容: ScriptAlias /php/ "E:/php/" //你本机的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" 至于文件存放目录,如果你不想放在htdocs下,只要把apache/conf/httpd.conf中的DocumentRoot改成你放php文件的目录即可。如:
DocumentRoot "E:/webroot"关于虚拟目录的设置,可以参考apache/conf/httpd.conf中的设置,照样改一下就可以了。如下:#<VirtualHost *>
# ServerAdmin [email protected]
# DocumentRoot /www/docs/dummy-host.example.com
# ServerName dummy-host.example.com
# ErrorLog logs/dummy-host.example.com-error_log
# CustomLog logs/dummy-host.example.com-access_log common
#</VirtualHost>配置好后将前面的注释符号(#)删除就可以了。不过你的情况应该还不需要使用虚拟目录。
解决方案 »
- 如何修改成为用户密码,验证码分开判断
- 我做的动态导航菜单 我都有点看不懂 求指正
- 做好的留言本 适合新手学习 偶
- define('ROOT_PATH', './../')里的“./../”是什么意思?
- 用php提取mysql数据库中的时间,在库中是05-5-21,到网页中显示时就变了!!!
- 用 FastTemplate 模板怎样处理其中的循环与分页问题??
- 如何关闭本机的808端口,我用的win2000professional
- 這樣認為對不對???表中有表,在使用 width 時,外層的用數字,內層可用數字和百分數,但外層用百分數內層就不能用數字.
- 如何在公司的框架上添加二维码
- API就是读取不到数据。什么原因
- 有趣的输出的小问题。来试试吧
- PHP+APACHE如何安装配置才能连接上ORACLE9I(在线等待)
The server encountered an internal error or misconfiguration and was unable to complete your request.Please contact the server administrator, [email protected] and inform them of the time the error occurred, and anything you might have done that may have caused the error.More information about this error may be available in the server error log.
--------------------------------------------------------------------------------Apache/2.0.43 Server at localhost Port 80
建议使用Apache 1.3.2x
我用的是apache_2.0.43-win32-x86-no_ssl.exe,不好吗?哪里有Apache 1.3.2x下载?
win下建议使用apache 1.3.2x
Alias /虚拟目录名称/ "G:/实际虚拟目录名称/"
ScriptAlias /php/ "d:/PHP安装目录/"
AddType application/x-httpd-php .php
Action application/x-httpd-php "/php/php.exe"