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.
Related Articles
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 1
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 4
- Install Web Server in Windows XP with Apache2, PHP5 and MySQL4 - Part 2
- Using phpMyAdmin for Effective MySQL Management in Windows XP
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 5
- Install, Setup and Configure CGI and Perl in Windows XP
- Installing Web Server in FreeBSD 6.0 with Apache 2.2, MySQL 5.0 and PHP 5 - Part 4
- Install phpBB 2 in Windows XP running on Apache 2, PHP 5 and MySQL 4
- Easily Set Up Web Server with XAMPP
- Subversion (SVN) Issues and Problems on mod_dav_svn in FreeBSD





















May 20th, 2006 03:42
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?
May 20th, 2006 14:33
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.
July 12th, 2006 19:10
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!!
July 12th, 2006 19:46
Looks like your web server doesn¡¯t parse PHP file and treat it as text file, follow the steps carefully.
July 13th, 2006 07:32
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!
July 13th, 2006 08:43
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!
September 10th, 2006 20:48
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.
October 7th, 2006 07:18
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/
February 19th, 2007 17:11
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¡±.
February 19th, 2007 17:23
u forgot a thing, for the apache..
modify DirectoryIndex and put index.php
in rest is a good tutorial
February 25th, 2007 01:30
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
******
February 25th, 2007 01:30
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
June 21st, 2007 13:10
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.