1. Apache µÄ°²×°
°²×°apache(×iаae±¾1.3.14)ºo£¬ÅaÖð²×°apacheconfĿ¼ÏµÄhttpd.confÎļþÈçÏ£º
1.1 ²eÕÒ#ServerName new.host.name£¬½«new.host.name¸u»»³ÉÄa×Ô¼ºµÄÖ÷»uÃu£¬ÈçÖ÷»uÃuΪ xman Ôo¸ÄΪ
ServerName xman
ͬʱ½«Ç°ÃaeµÄ#È¥µo¡£
1.2 ¢²¼ÄaµÄij¸oÎļþ¼Ð£º
ÈçÄaÏe¢²¼ÄaµÄĿ¼ d:myweb£¬¢²¼ÃuΪmyweb£¬ÔÚhttpd.confÎļþÖвeÕÒAlias£¬ÔÚÏÂÃaeÌi¼Ó
Alias /myweb "d:/myweb"
×¢ÒaÔÚApache 1.3.14ÖУ¬ÒýºÅÖеľ¶ÓÃ"/"¸o¿ª£¬¶ø²»ÄÜÓÃ""¡£
2. °²×°PHP£º
2.1 ½«php-4.0.4-Win32.zip(×iаae±¾4.0.4)½aѹËoµ½Ó²Å̵ÄÒ»¸oĿ¼ÖУ¬ÀýÈç½aѹµ½d:phpĿ¼ÖС£
2.2 ½«phpĿ¼ÖеÄphp4ts.dllÒƶ¯µ½windowsϵͳĿ¼Èç(c:windowssystem)ÖС£
2.3 ÔÙÐÞ¸Äapacheconfhttpd.confÎļþ£¬¼ÓÒÔÏÂÄÚÈÝ£º
LoadModule php4_module X:/php/sapi/php4apache.dll
AddType application/x-httpd-php .php
ÆaÖÐLoadModule ºÍ AddType ¾u¿ÉÒÔͨ¹ý²eÕÒÕÒµ½¡£
2.4 ½«php(d:php)Ŀ¼ÏµÄÎļþphp.ini-dist¿½±´ÖÁwindowsĿ¼(c:windows)Ï£¬²¢¸ÄÃuΪphp.ini¡£
Æo¶¯apache¡£
ÔÚÆo¶¯´°¿ÚÖÐÄa¾ÍÄÜ¿´µ½
Apache/1.3.14 (Win32) PHP/4.0.4 running...
µÄ×ÖÑu¡£
3 ²aÊÔ£º
±a¼Îļþhelloworld.phpÈçÏ£º
<?php
echo "Hello World!";
?>
ÔÚÆo¶¯Apacheºo£¬IEÖÐÇÃÈe£ºhttp://xman/myweb/helloworld.php
¿´µ½ Hello World! ¾Í±iʾÄaÒѾ³É¹¦°²×°Apache + phpÁË¡£
ÒÔÉÏApache°ae±¾ÎªApache1.3.14£¬php°ae±¾Îªphp4.0.4£¬ÆaËu°ae±¾µÄ¿ÉÄÜÓÐÒ»µa²»Í¬£¬µ«»u±¾²i²»¶a¡£ win2000ϺÍwin98Ï»u±¾Ïaͬ£¬Ö»ÊÇ°Ñphp4ts.dllŵ½WINNTSYSTEM32ϼ´¿É¡£ÆaÓa¿É²ÎÕÕ°²×°¡£°²×°³Éserviceʱ£¬¿ÉÄÜÓйرÕʱ³oÏÖ´iÎoµÄÇe¿o£¬¸Ä³Écgi½Ê½¾ÍÐÐÁË¡£
Copyright© 2013-2020
All Rights Reserved 京ICP备2023019179号-8