免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2638 | 回复: 8
打印 上一主题 下一主题

php+apache不能工作 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2003-05-03 13:56 |只看该作者 |倒序浏览
我的系统是Xp pro.在装完apache2+php4.3后.httpd正常工作.但执行脚本info.php的时候无任何反映.查看源文件可以看到php的源码.到php.net上看faq说是http服务器设置有问题.但并没有说是什么问题.
安装VBB正常.
脚本如下:
<?php
phpinfo();
?>;
请问怎么解决?
谢谢!

论坛徽章:
0
2 [报告]
发表于 2003-05-03 15:39 |只看该作者

php+apache不能工作

看看以前的贴子.

论坛徽章:
0
3 [报告]
发表于 2003-05-03 22:13 |只看该作者

php+apache不能工作

给个链接阿

论坛徽章:
0
4 [报告]
发表于 2003-05-04 13:32 |只看该作者

php+apache不能工作

httpd.conf上有至少两处需要改:
1。Options ExecCGI
2。AddHandler cgi-script .cgi .php
这时在unix上运行,在window上想必差不多,可能还要加上路径。

论坛徽章:
0
5 [报告]
发表于 2003-05-04 13:59 |只看该作者

php+apache不能工作

windows 上是三行:
LoadModule php4_module "c:/php/sapi/php4apache2.dll"
AddType application/x-httpd-php .php
DirectoryIndex index.php

论坛徽章:
0
6 [报告]
发表于 2003-05-09 22:05 |只看该作者

php+apache不能工作

suby是正确的!

论坛徽章:
0
7 [报告]
发表于 2003-05-10 21:34 |只看该作者

php+apache不能工作

我把上面那些内容拷进去,但也是不行啊,出现的错误是:
  Can't load c:\php4_module "c:/php/sapi/php4apache2.dll" into server

论坛徽章:
0
8 [报告]
发表于 2003-05-11 10:25 |只看该作者

php+apache不能工作

安装php为apache的模块的方法!(英文)
=============================
Installing PHP for Apache as module
  ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

  Now that version 4.1 introduces a safer sapi module, we recommend
  that you configure PHP as a module in Apache.

  To accomplish this, you have to load the php4apache.dll in your
  Apache httpd.conf.

  !! NOTE !!
  Whereever you load php4apache.dll from, php4apache.dll also
  needs the php4ts.dll also included in the PHP4 distribution.
  php4apache.dll depends on php4ts.dll which is loaded as soon as
  Apache loads php4apache.dll. If php4ts.dll can't be found, you
  usually get an error like (also see the "roblems?" section at
  the end of the file):

    Cannot load c:/php/sapi/php4apache.dll into server

  So where does php4ts.dll has to be to be properly loaded ?
  php4ts.dll is searched in the following order:

  1) in the directory where apache.exe is start from
  2) in the directory where php4apache.dll is loaded from
  3) in your %SYSTEMROOT%\System32, %SYSTEMROOT%\system and
     %SYSTEMROOT% directory.
     Note: %SYSTEMROOT%\System32 only applies to Windows NT/2000/XP)
  4) in your whole %PATH%

  Note: What is %SYSTEMROOT% ? Depending on your Windows
        installation this may be for example c:\winnt or C:\windows

  Usually you would just copy it over to %SYSTEMROOT%\System32.
  But if you want to have multiple PHP installations (for
  whatever reason) this is a bad idea. For this circumstance the
  safest thing is to let php4ts.dll reside in the same directory
  where php4apache.dll is loaded from (see point 2 above).


  After you've set up the file layout properly, you're ready to
  finally configure Apache to load the PHP4 module. Just add the
  following lines to your httpd.conf:

   LoadModule php4_module c:/php/sapi/php4apache.dll
   AddModule mod_php4.c
   AddType application/x-httpd-php .php

  Note: Especially newer versions of Apache do not need the
        AddModule directive anymore, your milage may vary.


  Where do I have to put the php.ini ?
   The php.ini files is only searched in two places:
   1) in your Apache installation directory (e.g. c:\apache\apache)
   2) in your %SYSTEMROOT% directory.
=====================================

论坛徽章:
0
9 [报告]
发表于 2003-05-11 10:34 |只看该作者

php+apache不能工作

上面的就是说:
1。如果你用apache1.3.x版本
则你需要再你的httpd.conf中加入如下:

LoadModule php4_module c:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php

2。如果你使用的是apache2.0.x版本

则要在httpd.conf中加入如下:
LoadModule php4_module c:/php/sapi/php4apache2.dll
AddType application/x-httpd-php .php

3。确认你的路径没有问题

4。复制你的php中的php4ts.dll和php.ini到你的apache.exe所在的目录!(切:务必使它们在同一目录中!这个很重要!)

5。编辑测试页面test.php内容如下:
<?php phpinfo(); ?>;
并且,将该文件保存在你服务器服务的根目录中!

6。从浏览器中输入http://localhost/test.php

7。看到了吧?呵呵!祝大家学习php快乐!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP