安装网络服务器在Windows XP与Apache2、PHP5和MySQL4 -第3部分

第3部分-安装PHP 5

拉开下载的PHP邮编包裹拉链 第1部分 对C:\PHP (创造一个新的文件夹被命名PHP在C:\根水平)。 然后关闭Apache Server。

打开亚帕基印第安人httpd.conf用文本编辑程序并且增加二个代码行:

LoadModule php5_module C :/php/php5apache2.dll
AddType application/xhttpdphp .php

增加的.php引伸到展示如何解析.php文件

也注意目录在装载模块点对,在哪里我们安装PHP。 如此,如果您安装PHP在其他地点,相应地改变它。 目录样式太应该是/而不是共同的DOS \。

这二条线可以增加到httpd.conf文件的底部。 然而,注意模块在装载名单按反向优先权顺序; 来最新罐头代理佣金或先占有及早被列出的那些的那些。 所以,增加php_mod在结尾的名单可能有意想不到的结果,例如使失去能力的mod_rewrite (和其他模块)为存在的所有php文件(mod_rewrite优良将跑,如果文件不存在)。 同一个错误可能使mod_auth和其他重要模块失去能力。 总之,应该装载php_mod,在您希望跑的任何模块之前,在您的php代码被执行之前。 看笔记在 亚帕基印第安人AddModule文献 为怎样发现被推荐的命令。

其次,拷贝或浆糊“php.ini推荐了”给C :/Program文件或亚帕基印第安人小组或者Apache2 (或您的亚帕基印第安人设施道路),和给它改名对php.ini。 重新开始Apache Server。

测试的php5设施

创造一个文件与以下内容并且保存它对根网文件夹(C :/Server/htdocs或缺省C :/Program文件或亚帕基印第安人小组或者Apache2/htdocs/)作为“php5info.php”。

<?php
phpinfo ();
?>

访问以下URL http://localhost/php5_info.php. 在浏览器应该显示完全PHP设置。 如果错误或没什么显示,有问题与设施。 再试一次安装程序。

使能MySQL引伸

从php.ini被推荐的已经被设置复制到最宜的设置的php.ini,那么那里是没有特别需要编辑它。 然而,它仍然需要编辑使能mysql引伸。

打开php.ini在Apache2目录用文本编辑程序。

查寻线 extension_dir = “。/”. 改变它 extension_dir = “C:\php5\ext”. 并且, uncomment线 extension=php_mysql.dll.

保存php.ini。 重新开始Apache Server。 再试到通入 http://localhost/php5_info.php. 它应该优良工作。 If not try to check what’s the cause of errors, which most likely due to wrong extension_dir or missing extension. Or you may try to copy all the needed extentions (with .dll extenstion) to Apache2 directory.

IMPORTANT: This is a machine translated page which is provided "as is" without warranty. Machine translation may be difficult to understand. Please refer to original English article whenever possible.

Share and contribute or get technical support and help at My Digital Life Forums.



13 Responses to “Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 3”

  1. Todd
    May 20th, 2006 03:42
    1

    well, I have followed your directions and everyone else’s before this, but no luck. After adding the module declaration in the httpd.conf file, when I restart apache i get - syntax error: cannot load specific module. all of my paths are correct what is the problem?

  2. Administrator
    May 20th, 2006 14:33
    2

    Hi Todd, the issue might be related to mod_perl (if you’re using it as ActivePerl). If you install Apache/2.2, please use mod_perl that is compiled with Apache 2.2 and not Apache 2.0 for compatibility issue.

  3. greg
    July 12th, 2006 19:10
    3

    I have the server set up and i can read a php file if i start it withhtml tags but it doesnt read the php script i put in. if i dont use the html tags i get a download box when i click on the link to test the php?? can u help me!!

  4. Administrator
    July 12th, 2006 19:46
    4

    Looks like your web server doesn’t parse PHP file and treat it as text file, follow the steps carefully.

  5. greg
    July 13th, 2006 07:32
    5

    ok i reset it and now the server cannot find php5apache2.dll? It is in the php folder. I am using php5.1.4 and apache2.2.2!

  6. greg
    July 13th, 2006 08:43
    6

    I got it to work i uninstalled apache 2.2 and installed 2.0 and followed your steps again and now it is all working:)

    Thank you for the help!

  7. Tom
    September 10th, 2006 20:48
    7

    There seems to be a problem with Apache 2.2 and the PHP dll modules (on Windows obviously, don’t know if there are any problems on unix). I fixed it by going to http://www.apachelounge.com/download/ and downloading their version of the php4apache2.dll file. This also comes with another file which you have to put in your Apache/bin directory, and you will also need to download a MS Visual C++ Package if you don’t have the .NET framework installed. This is all explained in the readme file that comes with the DLL.

  8. cary
    October 7th, 2006 07:18
    8

    With Apache 2.2, you will need PHP 5.2.x. It has the php5apache2_2.dll that is compiled for the new version. You can download a stable build at http://snaps.php.net/

  9. JaD
    February 19th, 2007 17:11
    9

    You said…

    Search for the line of extension_dir = “./”. Change it to extension_dir = “C:\php5\ext”. Also, uncomment the line of extension=php_mysql.dll.

    Save the php.ini. Restart the Apache server. Re-try to access http://localhost/php5_info.php. It should working fine. If not try to
    …..
    …..
    “C:\php5\ext”. ?????? — the correct line is
    “C:\php\ext”.

  10. JaD
    February 19th, 2007 17:23
    10

    u forgot a thing, for the apache..
    modify DirectoryIndex and put index.php
    in rest is a good tutorial :P

  11. Asokan
    February 25th, 2007 01:30
    11

    I am trying to connect mysql5 from apache2 but
    browser showing an error

    Warning: require(/config/db_config.php) [function.require]: failed to open stream: No such file or directory in C:\webroot\dbconnect.php on line 2

    Fatal error: require() [function.require]: Failed opening required ‘/config/db_config.php’ (include_path=’.;C:\php5\pear’) in C:\webroot\dbconnect.php on line 2

    I am using,MySQL5, PHP5 and Apache2.2 running windows xp
    Request your help
    Thanking you
    ******

  12. Asokan
    February 25th, 2007 01:30
    12

    I am trying to connect mysql5 from apache2 but
    browser showing an error

    Warning: require(/config/db_config.php) [function.require]: failed to open stream: No such file or directory in C:\webroot\dbconnect.php on line 2

    Fatal error: require() [function.require]: Failed opening required ‘/config/db_config.php’ (include_path=’.;C:\php5\pear’) in C:\webroot\dbconnect.php on line 2

    I am using,MySQL5, PHP5 and Apache2.2 running windows xp
    Request your help
    Thanking you
    Asokan

  13. Handril
    June 21st, 2007 13:10
    13

    I have succes install apache 2, php5 and MySQL 5. I can display php info. But, why php script that I make can not run in the IE browser. this simple script like this:

    I use Windows XP.

    Thank you for your attention.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Subscribe without commenting


Custom Search

New Articles

Incoming Search Terms for the Article

error trying access httpd.conf file - error trying access httpd.conf - error trying to access httpd.conf file - error trying access httpd.conf file. You will need to manually configure the web server - php5 apache2 windows - error trying to access httpd.conf - Error trying access httpd.conf file. You will need to manually configure the web server. - "error trying access httpd.conf file" - error trying access httpd.conf file. - error trying to access httpd.conf file. you will need to manually configure the web server - php apache windows - "error trying access httpd.conf" - php5 apache2 - apache php windows - php5 apache2.2 - php error trying access httpd.conf - windows apache php5 - "error trying to access httpd.conf" - PHP error trying access httpd.conf file - you will need to manually configure the web server - apache windows php - windows apache2 php5 - Apache2 php5 - trying to access httpd.conf file manually configure - php error httpd.conf you will need to manually configure server - php error trying to access httpd.conf file - Error Trying access httpd.conf php - apache2.2 php5 - error trying access httpd.conf file you will need to manually configure the web server - apache2.2 php5 windows - php 5.2.x enabled web server - install php5 and apache2 - error trying access httpd.conf - php install error trying access httpd.conf - php error trying to access httpd.conf - C:\php5\pear - error trying access httpd.conf file php - "error trying to access httpd.conf file" - error trying to access httpd.config file - php5 apache2.2 xp - Error trying access httpd.conf file. - php error access httpd.conf - webroot of a php 5.2.x enabled web server - apache2 php5 windows - error trying acces httpd.conf - apache2 php5 XP - php "error trying access httpd.conf" - Apache 2.2 PHP "Error trying to access httpd.conf file" - install PHP5 apache2.2 - php5 apache2 installation -