doc.php应该放在apache得主目录下
apache\htdocs\下面

解决方案 »

  1.   

    我记得是 http://localhost/doc.php
    斜杠打反了
      

  2.   

    你在apache中设人铁虚拟目录了吗?
      

  3.   

    你在apache中设人铁虚拟目录了吗?
    在Windows98/2K下安装全最新版Apache + PHP4 + MYSQL + phpMyadmin的方法 Version 2.2
    首先通报一下以上软件现在最新的版本号:
    Apache 1.3.24
    PHP 4.2.0
    MYSQL 3.23.41a
    phpMyadmin 2.2.6*************
    *一.基本安装*
    *************
    还用说吗?大家已经人手一份程序,把他们全装上就行了~!呵呵~~建议把他们都装在一个目录下,方便使用嘛。
    注意:如果有最新版的程序,建议安装最新版的,这样子很有可能解决以前出现的问题!切记!:)这里假设Windows98/2K装在目录windir下。其它程序建议安装如下:
    x:\SERVER
     |
     |-PROGRAM
        |
        |-PHP PHP程序目录
        |
        |-MYSQL MYSQL程序目录
        |
        |-MYADMIN phpMyadmin程序目录
        |
        |-APACHE 服务器程序目录*********
    *二.设置*
    *********
    关键就是这里了!大家一步一步慢慢来~!*****
    *(1)*将PHP目录下的PHP4TS.DLL复制到windir\system(Win2K是system32),还有将PHP.INI-DIST复制到windir,改名为PHP.INI
    *****有一些无关紧要的设置,按自己的需要改吧~:
    upload_max_filesize = 2097152; 上载文件的最大字节
    include_path = \path1;\path2;\path3…… 在使用include函数时,只有指定目录下的文件才可以被包含******************************************************************************************
    关于Session : 有些人说PHP在运行Session的会显示错误,这个问题多半是因为没有为Session建立一个叫
    tmp的目录。方法:在x:\下面建立一个tmp的目录。
    ***********************************************************************************************
    *(2)*修改Apache的配置文件
    *****在安装的时候,Apache会提示你输入服务器名等,其实都不重要的。因为这些可以后来再改的,哈哈。最重要的,是修改CONF目录下的HTTPD.CONF文件:
    Servername xxxxxx 改为 Servername localhost******************************************************************************************
    注意:
    (1)有人反映,如上设置后,别人的机器无法访问到自己的服务器,访问时会转向localhost。
    这个是Apache的问题,有如下规律:如果访问的URL是 http://你的IP/目录
    Apache收到请求后 会把URL解析到你所设的ServerName 也就是localhost
    那客户方就会访问失败了。要改成 http://你的IP/目录/
    才能正常访问.另外.这个问题在直接访问文件的时候不存在.(2)在DocumentRoot的下面不远,会有这样几行:
    #
    # This should be changed to whatever you set DocumentRoot to.
    #
    <Directory "E:/server/program/Apache/htdocs">下面有一行:
        Options FollowSymLinks MultiViews Indexes请把Indexes删除,改成
        Options FollowSymLinks MultiViews这样,htdocs就不会被列出目录列表,要不是太没有安全感啦!大家一定要改!!
    ******************************************************************************************让Apache支持PHP其实也是很容易的呀,加上下面这么几句,就可以了!
    ScriptAlias /php4/ "x:/PROGRAM/SERVER/PHP/"
    AddType application/x-httpd-php4 .php
    AddType application/x-httpd-php4 .php3
    AddType application/x-httpd-php4 .php4
    AddType application/x-httpd-php-source .phps
    Action application/x-httpd-php4 "/php4/php.exe"这是以CGI方式运行PHP程序!
    运行Apache后,显示
    Apache/1.3.24 (Win32) running...如果想要以模块方式运行,请按这样子:
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php .php3
    AddType application/x-httpd-php .php4
    AddType application/x-httpd-php-source .phps
    LoadModule php4_module "x:/server/program/php/sapi/php4apache.dll"运行Apache后,显示
    Apache/1.3.24 (Win32) PHP/4.2.0 running...强烈推荐使用模块方式!!!Apache的默认启动文档为index.html、index.html还有DirectoryIndex,我们改成这样,支持更多的文档:
    DirectoryIndex index.htm
    DirectoryIndex index.html
    DirectoryIndex index.php
    DirectoryIndex index.php3
    DirectoryIndex index.php4好,已经完成了……一半(*#$*^&(#*&%#*&@……)!不过还是先写用phpinfo()写一个测试文件看看吧!:)******************************************************************************************
    Win2K的Apache是以服务方式运行,方法是在控制台中运行Apache -i安装服务,运行Apache -u卸载服务。
    ***********************************************************************************************
    *(3)*设置MYSQL
    *****在目录下有一个文件MY-EXAMPLE.CNF拷贝到C:\下面,改名为MY.CNF
    可以加入用户名,密码,登陆主机,数据库和端口等信息!到BIN目录下,运行MYSQLD-MAX(感觉这个是最好的)!正常情况下DOS窗口一闪而过, 然后按Ctrl+Alt+Del看看有没有,有就是行啦~:)******************************************************************************************
    Win2K的MYSQL也是以服务方式运行,方法是在控制台中运行mysqld-max-nt --install安装服务,运行
    mysqld-max-nt --remove卸载服务。然后要在winmysqladmin中设置my.ini文件,这是Win2K与Win98差别
    最大的地方!!切记!!
    ******************************************************************************************
    *****
    *(4)*设置phpMyadmin
    *****最新版的phpMyadmin比以前的几版又强大了很多!推荐大家使用!首选修改:
    $cfgPmaAbsoluteUri = '';
    改成你的phpmyadmin所在的目录
    $cfgPmaAbsoluteUri = 'http://localhost/myadmin/';
    需要修改一下目录下的config.inc.php文件,把174行的:
    $cfgDefaultLang = 'en';
    改为
    $cfgDefaultLang = 'zh';这样就成中文版的了!虽然意思有点别扭……呵呵~!还有这里:
    $cfgServers[$i]['host']          = 'localhost'; // MySQL hostname
    $cfgServers[$i]['port']          = '';          // MySQL port - leave blank for default port
    $cfgServers[$i]['socket']        = '';          // Path to the socket - leave blank for default socket
    $cfgServers[$i]['connect_type']  = 'tcp';       // How to connect to MySQL server ('tcp' or 'socket')
    $cfgServers[$i]['controluser']   = '';          // MySQL control user settings
                                                    // (this user must have read-only
    $cfgServers[$i]['controlpass']   = '';          // access to the "mysql/user"
                                                    // and "mysql/db" tables)
    $cfgServers[$i]['auth_type']     = 'config';    // Authentication method (config, http or cookie based)?
    $cfgServers[$i]['user']          = 'root';      // MySQL user
    $cfgServers[$i]['password']      = '';          // MySQL password (only needed
                                                    // with 'config' auth_type)
    $cfgServers[$i]['only_db']       = '';          // If set to a db-name, only
                                                    // this db is displayed
                                                    // at left frame
                                                    // It may also be an array
                                                    // of db-names
    $cfgServers[$i]['verbose']       = '';          // Verbose name for this host - leave blank to show the hostname
    $cfgServers[$i]['bookdb']    = '';          // Book db - leave blank for no book support
    $cfgServers[$i]['booktable'] = '';          // Book table - leave blank for no book support
    $cfgServers[$i]['relation']      = '';          // table to describe the relation between links (see doc)
                                                    //   - leave blank for no relation-links support一般按默认就可以了!这里是有关登录MYSQL服务器的设置,按上面改,缺啥补啥,这样就是使用MYSQL的缺省配置啦~呵呵:)到此,全部安装完成!去爽吧~:) 
     
      

  4.   

    最上头那位没看到是doc_root=c:\php\test吗?
      

  5.   

    in fact I have once put doc.php in apache\htdocs
    input url=\localhost\doc.php
    Although Ie can find this file ,the result not show correctly php document told me if we configure doc_root=c:\php\test in php.ini,it means the file extend .php only in c:\php\test can be executed,so localhost\doc.php directed to c:\php\test\doc.php
      

  6.   

    <FORM METHOD=POST ACTION="mod.php">
    <INPUT TYPE="text" NAME="num1">
    <INPUT TYPE="text" NAME="num2">
    <INPUT TYPE="submit">
    </FORM>
    <?
    $num=$num1%$num2;
    ?>
    <INPUT TYPE="text" NAME="num" value="<? if($num==0) echo ""; else echo $num ; ?>">
    试试能正常用不如果要能正常用就得了
      

  7.   

    to anziqi:   ScriptAlias /php/    "c:/php/"
         AddType application/x-httpd-php4 .php
         AddType application/x-httpd-php4 .php3 
         AddType application/x-httpd-php4 .php4 
         Action application/x-httpd-php3 "/php/php.exe" 
         LoadModule php4_module "c:/php/sapi/php4apache.dll"
    ....
      I just do as you said ,but same result:The requested URL /doc.php was not found on this server.
      

  8.   

    to blackcat:   same result
      

  9.   

    to blackcat:
       same result
      

  10.   

    to anziqi:  in dos console 
    type c:\apache\apache.exe
    it shows appache is running.but not shows php4 is running
      

  11.   

    www.cszlf.net
    里有个三和一的东西
    你直接安装就行了
    www.phpuser.com有如何配置如果你想直接学php就下载
    如果要想自己来就到那里看看如何配置
      

  12.   

    I find the reason why  my configure is wrongScriptAlias /php/    "c:/php/"
     AddType application/x-httpd-php4 .php
     AddType application/x-httpd-php4 .php3 
     AddType application/x-httpd-php4 .php4 
     Action application/x-httpd-php3 "/php/php.exe" change it as
    ScriptAlias /php/    "c:/php/"
     AddType application/c-httpd-php4 .php
     AddType application/c-httpd-php4 .php3 
     AddType application/c-httpd-php4 .php4 
     Action application/c-httpd-php3 "/php/php.exe" 
      

  13.   

    plz read this article:
    http://www.devarticles.com/content.php?articleId=202&page=2
      

  14.   

    请贴出logs\error.log
    的相关内容
      

  15.   

    从描述的现象上看,应当把apache的文档主目录改到c:\php\test\就可以了
      

  16.   

    Your English is very good.
    Do your compute works correctly now?
    I installed apache in my computer somedays ago,but it don't works correctly.My computer operating system is windows 2000 professional,too.Later I installed iis.It is easy to configre.