Apache2, PHP5 ¹× MySQL4 - ºÎ 3¸¦ °¡Áø Windows XP¿¡ ÀÖ´Â À¥ ¼­¹ö¸¦ ¼³Ä¡ÇϽʽÿÀ

ºÎ 3 - PHP 5¸¦ ¼³Ä¡ÇϽʽÿÀ

¾ÈÀ¸·Î ´Ù¿î·ÎµåÇÑ PHP zip Æ÷ÀåÀ» ÁöÆÛ¸¦ ¿©½Ê½Ã¿À ºÎ 1 C:\PHP¿¡ (C:\ »Ñ¸® ¼öÁØ¿¡ PHPÀ̶ó°í Áö¸íµÈ »õ·Î¿î Æú´õ¸¦ âÁ¶ÇϽʽÿÀ). ±× ¶§ Apache Server¸¦ ²ô½Ê½Ã¿À.

¹®¼­ ÆíÁý±â¸¦ °¡Áø ¾ÆÆÄÄ¡ httpd.conf¸¦ ¿­°í 2°³ÀÇ ÄÚµå ÇàÀ» Ãß°¡ÇϽʽÿÀ:

LoadModule php5_module C: /php/php5apache2.dll
AddType application/x httpd php .php

¼î¿¡ Ãß°¡µÈ .php ¿¬Àå .php ÆÄÀÏÀ» ºÐ¼®ÇÏ´Â ¹æ¹ý

¿ì¸®°¡ PHP¸¦ ¼³Ä¡ÇÑ ºÎÇÏ ¸ðµâ Á¡¿¡ ÀÖ´Â ÀüÈ­¹øÈ£ºÎ¸¦ ¶ÇÇÑ ÁÖÀÇÇϽʽÿÀ. ÀÌ·¸°Ô ´ç½ÅÀÌ ´Ù¸¥ À§Ä¡¿¡ PHP¸¦ ¼³Ä¡ÇÏ´Â °æ¿ì¿¡, ±×°ÍÀ» ±×·¯¹Ç·Î ¹Ù²Ù½Ê½Ã¿À. ÀüÈ­¹øÈ£ºÎ ÀÛdzÀº/ÀϹÝÀûÀÎ DOS ´ë½Å¿¡ À̱â À§ÇÏ¿© \ ³Ê¹« ÀÏ °ÍÀδÙ.

ÀÌ 2°³ÀÇ ¼±Àº httpd.conf ÆÄÀÏÀÇ ¹Ù´Ú¿¡ Ãß°¡µÉ ¼ö ÀÖ´Ù. ±×·¯³ª Áü ¸íºÎ¿¡ ÀÖ´Â ´ÜÀ§°¡ ¹ÝÀü ¿ì¼±±Ç ¼ø¼­¿¡ ´Ù´Â °ÍÀ», ÁÖÀÇÇϽʽÿÀ; ÃֽбøÅë Ä¿¹Ì¼Ç ¿À°Å³ª ¸ÕÀú ¸ñ·ÏÀ¸·Î ¸¸µé¾îÁø ±×µéÀ» ¼±¸ÅÇÏ´Â ±×µé. ±×·¯¹Ç·Î ÆÄÀÏÀÌ Á¸ÀçÇÏÁö ¾Ê´Â °æ¿ì¿¡), ¸íºÎÀÇ ³¡ºÎºÐ¿¡ php_mod¸¦ Ãß°¡ÇÏ´Â °Í¿¡´Â Á¸ÀçÇÏ´Â ¾î¶² php ÆÄÀϵçÁö¸¦ À§ÇÑ ¹«´ÉÇÏ°Ô ÇÏ´Â mod_rewrite (¹× ´Ù¸¥ ´ÜÀ§)¿Í °°Àº ÀÇ¿Ü °á°ú°¡ ÀÖÀ» ¼ö ÀÖ´Ù (mod_rewrite´Â Àß ´Þ¸± °ÍÀÌ´Ù. µ¿ÀÏÇÑ °ú½ÇÀº mod_auth¿Í ´Ù¸¥ Áß¿äÇÑ ´ÜÀ§¸¦ ¹«´ÉÇÏ°Ô ÇÒ ¼ö ÀÖ´Ù. ¿ä¾àÇÏÀÚ¸é, php_mod´Â ´ç½ÅÀÇ php ºÎÈ£°¡ ¼öÇàµÇ±â Àü¿¡ ´ç½ÅÀÌ ´Þ¸®´Â °ÍÀ» ¹Ù¶ó´Â ¾î¶² ´ÜÀ§ Àü¿¡ ÀûÀçµÇ¾î¾ß ÇÑ´Ù. ¿¡ ÀÖ´Â ÁÖ¸¦ º¸½Ê½Ã¿À ¾ÆÆÄÄ¡ AddModule ¹®¼­ ÃßõµÈ ÁÖ¹®À» ã¾Æ³»´Â ¹æ¹ýÀ» À§ÇØ.

´ÙÀ½, »çº» ¶Ç´Â Ç®Àº "C¿¡°Ô php.ini ÃßõÇß´Ù": /Program ÆÄÀÏ ¶Ç´Â ¾ÆÆÄÄ¡ ±×·ì ¶Ç´Â Apache2 (¶Ç´Â ´ç½ÅÀÇ ¾ÆÆÄÄ¡ ÀÓ¸í °æ·Î php.ini¿¡), ±×¸®°í ±×°ÍÀ» °³¸íÇÑ´Ù. Apache Server¸¦ ÀçÃâ¹ßÇϽʽÿÀ.

½ÃÇè php5 ÀÓ¸í

ÆÄÀÏÀ» µÚ¿¡ ¿À´Â ³»¿ëÀ¸·Î âÁ¶ÇÏ°í »Ñ¸® À¥ Æú´õ (C¿¡ ÀúÀåÇϽʽÿÀ: /Server/htdocs ¶Ç´Â °úÅ C: "php5info.php"·Î /Program ÆÄÀÏ ¶Ç´Â ¾ÆÆÄÄ¡ ±×·ì ¶Ç´Â Apache2/htdocs/).

<? php
phpinfo ();
?>

µÚ¿¡ ¿À´Â URL¿¡ Á¢±ÙÇϽʽÿÀ http://localhost/php5_info.php. ¿ÏÀüÇÑ PHP Á¶Á¤Àº ºê¶ó¿ìÀú¿¡ Ç¥½ÃµÇ¾î¾ß ÇÑ´Ù. ¸¸¾à¿¡ °ú½Ç ¶Ç´Â ¾Æ¹«°Íµµ º¸ÀÌ ¾øÀ¸¸é, ÀÓ¸í¿¡ ´ëÇÑ ¹®Á¦°¡ ÀÖ´Ù. ¼³Ä¡ ÀýÂ÷¸¦ Àç½ÃµµÇϽʽÿÀ.

MySQL ¿¬ÀåÀ» °¡´ÉÇÏ°Ô ÇϽʽÿÀ

php.ini ÃßõÇÑ ÀÌ¹Ì ³õÀ̱⿡¼­ ÃÖÀû Á¶Á¤¿¡ º£³¤ php.ini´Â, ÀÌ·¸°Ô °Å±â ±×°ÍÀ» ÆíÁýÇϴ Ưº°ÇÑ Çʿ䰡 ¾ø´Ù. ±×·¯³ª, ±×°ÍÀº ¾ÆÁ÷µµ mysql ¿¬ÀåÀ» °¡´ÉÇÏ°Ô Çϱâ À§ÇÏ¿© ÆíÁýÇÒ Çʿ䰡 ÀÖ´Ù.

¹®¼­ ÆíÁý±â¸¦ °¡Áø Apache2 ÀüÈ­¹øÈ£ºÎ¿¡ ÀÖ´Â php.ini¸¦ ¿©½Ê½Ã¿À.

¼±À» À§ÇÑ ¼ö»öÀÇ 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 - php5 apache2 windows - error trying access httpd.conf file. You will need to manually configure the web server - 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" - you will need to manually configure the web server - PHP error trying access httpd.conf file - 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 - all -