Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

WindowsÏ°²×°×îеÄApache+PHP+MySQLÖ¸ÄÏ



   ´ËÎÄյݲװ·½·¨ÊÊÓÃÓÚWindows XP
쵀Apache+PHP+MySQL
°²×°£¬Í¬Ê±Ò²ÊÊÓÃÓÚWindows 2003
ϵͳϵݲװºÍÅäÖá£
1.
°²×°»·¾³
²Ù×÷ϵͳÊÇ Windows XP
ÖÐÎÄ°æ, Apache,
PHP, MySQL
µÄ×îа汾ÊǽØÖ¹µ½ 2007.09.07
£¬·Ö±ðÔÚÆä¹ÙÍøÏÂÔصÄ:
* Apache 2.2.6
£ºhttp://apache.mirror.phpchina.com/httpd/binaries/win32/
* PHP 5.2.4 (Windows Binaries PHP 5.2.4 zip package
£©:
http://www.php.net/downloads.php
* MySQL 5.0.45 Windonws: http://dev.mysql.com/downloads/
2.
°²×°µÄĿ¼½á¹¹¹æ»®
ΪÁË·½±ãά»¤£¬¿ÉÒÔ½«·þÎñÆ÷Èí¼þ°²×°ÔÚϵͳÅÌ£¨C
ÅÌ£©¶ø°Ñ×Ô¼ºµÄÎļþ¶¨Î»µ½ÆäËûÅÌ£¬ÕâÑù¶ÔÓÚÒÔºóµÄά»¤ºÜÖØÒª¡£
3.
ÔÚ Windows XP
Ï°²×° Apache 2.2.6
Windows XP
ϵݲװ
1.
ÔËÐÐ apache 2.2.6
µÄ°²×°³ÌÐò£¬¸ù¾ÝÌáʾһ·
Next
¼´¿É¡£ÔÚ Server Information
µÄ
Network Domain
¡¢Server Name
×Ö¶ÎËæ±ãÌîÉÏÒ»¸öÓòÃû¼´¿É£¬Èçphp.com
£¬È»ºó¸ù¾ÝÌáʾһ· Next
Íê³É¼´¿É¡£
2.
ÔÚ°²×°½áÊøʱ£¬»áµ¯³öÒ»¸ö DOS
´°¿Ú£¬È»ºó¾ÍÏûʧÁË£¬ÕâÊÇϵͳapache
×Ô¶¯Æô¶¯ÁË¡£
4.
ÔÚ Windows XP
Ï°²×° php 5.2.4
1.
½«ÏÂÔØµÄ php 5 ZIP
°üÖ±½Ó½âѹ£¬ÎÒÖ±½Ó½«
PHP 5.2.4 zip
Îļþ½âѹµ½ d:\php
Ŀ¼ÏÂÃæ¡£°²×° php
²»½¨ÒéʹÓà win32
°²×°³ÌÐò(
Ö÷ÒªÊÇÒÔºó°²×°À©Õ¹Âé·³£©¡£
2.
ÔÚ×ÊÔ´¹ÜÀíÆ÷ÖнøÈë php
µÄ°²×°Ä¿Â¼£¬½« php.ini-dist
»ò php.ini-recommended
¸´ÖÆÒ»·Ý£¬ÃüÃûΪ php.ini
¡£È»ºó´ò¿ª php.ini
¡£
3.
ÕÒµ½:
;extension=php_mysql.dll
½«Ç°ÃæµÄ ;
ºÅÈ¥µô£¬ ¸Ä³É£º
extension=php_mysql.dll
4.
ÕÒµ½:
extension_dir = “./”
½«Æä¸ÄΪÄãµÄ php
°²×°Ä¿Â¼Ï ext
×ÓĿ¼µÄ¾ø¶Ô·¾¶¡£ÀýÈçÎҵģº
extension_dir = “D:/php/ext/”
Õâ²½ºÜÖØÒª ¡£·ñÔò½ÓÏÂÀ´ php
»áÕÒ²»µ½ php_mysql.dll
Ä£¿é£¬ÎÞ·¨×°ÔØ¡£
5.
ÔÚ“
¿ØÖÆÃæ°å”->“
ϵͳ”->“
¸ß¼¶”->“
»·¾³±äÁ¿”
£¬ÔÚ“
ϵͳ±äÁ¿”
ÀïÃæÕÒµ½path
£¬±à¼­path
µÄ±äÁ¿Öµ£¬Ìí¼ÓÄãµÄphp
Ŀ¼D:\php
£¬Ç°ÃæÒ»¶¨ÒªÓ÷ֺÅ(;)
°ÑËüºÍÇ°ÃæµÄÖµ·Ö¿ª¡£
5.
ÅäÖÃ Apache
ºÍ PHP
´ò¿ª Apache
°²×°Ä¿Â¼Ï嵀 conf
×ÓĿ¼ÖÐµÄ httpd.conf
Îļþ¡£
1.
ÕÒµ½£º
DocumentRoot “xxxxxxx&rd


Ïà¹ØÎĵµ£º

phpÖÐset_include_pathº¯ÊýµÄÓ÷¨

phpÖÐset_include_pathº¯ÊýÓ÷¨£º
phpÖеÄset_include_pathº¯Êý¿ÉÓÃÓÚÉèÖÃÓ¦ÓóÌÐòĿ¼,¿ª·¢ÏîĿʱºÏÀíÓ¦ÓÃÕâЩº¯Êý,²»µ«¿ÉÒÔÈÃÎÒÃÇÔÚincludeʱ²»ÓÃÒ»²ãÒ»²ãµÄ¼ÆËãĿ¼,»¹¿ÉÒÔÌá¸ßÎÒÃÇ¿ª·¢µÄЧÂÊ,¼õÉÙÎļþ°üº¬´íÎóÂÊ.
ÀýÈ磺
¼òÀú2¸öphpÎļþ,Ò»¸öĿ¼
λÖýṹÈçÏÂ
/index.php
/include/config.php
index.php ......

mysqlÂÒÂëÎÊÌâ

½â¾öMySqlÊý¾ÝÂÒÂë:
1 д¹ýÂËÆ÷ÉèÖñàÂë¸ñʽ(¸ñʽºÍJSPÒ³ÃæµÄ±àÂëÒ»Ñù)£¬»òÔòÔÚÇëÇóÀïÃæдrequest.setCharacterEncoding("±àÂ뷽ʽ");
2 Èç¹ûÊDzéѯ³öÊý¾ÝÂÒÂ룬ÔÚÁ´½ÓµÄURLÉϼÓÉϱàÂë¸ñʽ(ÄãÕâÀï¼ÓÁË£¬Ã»ÎÊÌâ);
3 ÐÞ¸Ämy.iniÎļþÀïÃæµÄ default-character-set= ÄúÒªµÄ±àÂë¸ñʽ (Ò»¹²ÓÐÁ½´¦£¬Äã²éÕÒһϠ¸ÄΪһÑùµÄ±à ......

phpѧϰ±Ê¼Ç£¨5£©:PHPÌõ¼þÓï¾äµÄ½éÉÜÓëÓ¦Óãº


PHPÌõ¼þÓï¾äµÄ½éÉÜÓëÓ¦ÓÃ
1¡¢if Ìõ¼þÓï¾ä
if(expr)
    echo TRUE
else
    echo FALSE
if(expr) {
    echo TRUE
}else{
    echo FALSE
}
f(expr) {
    echo&n ......

PHPÖÐÕýÔò±í´ïʽµÄʹÓ÷½·¨[±Ê¼Ç]

ÔÚѧϰphpʱ£¬¿´µ½µÄ£¬×ö¸ö±Ê¼Ç
×Ö·û´®Í·²¿£º^
<?php echo ereg(“^hello”,”hello world!”); ?>
 
×Ö·û´®Î²²¿£º$
<?php echo ereg(“bye$”,”goodbye”); ?>
 
ÈÎÒâµÄµ¥¸ö×Ö·û£º.
<?php echo ereg(“.”,”goodbye”); ......

½â¾öÔ¶³ÌÁ¬½Ómysql´íÎó1130´úÂëµÄ·½·¨

http://hi.baidu.com/qk618/blog/item/f61e5830f2125d93a9018e0c.html
½â¾öÔ¶³ÌÁ¬½Ómysql´íÎó1130´úÂëµÄ·½·¨
½ñÌìÔÚÓÃÔ¶³ÌÁ¬½ÓMysql·þÎñÆ÷µÄÊý¾Ý¿â£¬²»¹ÜÔõôŪ¶¼ÊÇÁ¬½Ó²»µ½£¬´íÎó´úÂëÊÇ1130£¬ERROR 1130: Host 192.168.2.159 is not allowed to connect to this MySQL server
²ÂÏëÊÇÎÞ·¨¸øÔ¶³ÌÁ¬½ÓµÄÓû§È¨ÏÞÎÊÌâ¡£½á¹ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ