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º¯Êý¿ÉÓÃÓÚÉèÖÃÓ¦ÓóÌÐòĿ¼,¿ª·¢ÏîĿʱºÏÀíÓ¦ÓÃÕâЩº¯Êý,²»µ«¿ÉÒÔÈÃÎÒÃÇÔÚincludeʱ²»ÓÃÒ»²ãÒ»²ãµÄ¼ÆËãĿ¼,»¹¿ÉÒÔÌá¸ßÎÒÃÇ¿ª·¢µÄЧÂÊ,¼õÉÙÎļþ°üº¬´íÎóÂÊ.
ÀýÈ磺
¼òÀú2¸öphpÎļþ,Ò»¸öĿ¼
λÖýṹÈçÏÂ
/index.php
/include/config.php
index.php ......
ÌâÄ¿£º¸ø¶¨Ò»¸ö·Ö¸î·û£¬ÔõÑùµÃµ½¸ø¶¨×Ö·û´®×îºóÒ»¸ö·Ö¸î·ûºóµÄ×Ö·û´®¡£ È磺‘fsb-ibees-zxj-fsbk’ ÔõÑùµÃµ½fsbk, ÒªÇó£ºjavaʵÏÖ£¬sqlʵÏÖ£¿sql¿ÉÒÔÊÇoracle£¬mysqlµÈʵÏÖ¡£
1.OracleʵÏÖ
SET SERVEROUTPUT ON;
DECLARE
str VARCHAR2(266):='123-890-ibees-zxj';--±»½âÎöµÄ×Ö·û´®
splitStr VARCH ......
ÔÚѧϰphpʱ£¬¿´µ½µÄ£¬×ö¸ö±Ê¼Ç
×Ö·û´®Í·²¿£º^
<?php echo ereg(“^hello”,”hello world!”); ?>
×Ö·û´®Î²²¿£º$
<?php echo ereg(“bye$”,”goodbye”); ?>
ÈÎÒâµÄµ¥¸ö×Ö·û£º.
<?php echo ereg(“.”,”goodbye”); ......
Î塢ʼþµ÷¶ÈÆ÷²âÊÔ
5.1¡¢²âÊÔÄ¿µÄ
5.1.1 ÅäÖ÷½·¨
5.1.2 ÊÇ·ñÕý³£¹¤×÷
5.1.3 ÈÕ³£µÄά»¤
5.2¡¢Ê¼þµ÷¶ÈÆ÷½éÉÜ
×ÔMySQL5.1.6Æð£¬Ôö¼ÓÁËÒ»¸ö·Ç³£ÓÐÌØÉ«µÄ¹¦ÄÜ
–ʼþµ÷¶ÈÆ÷(Event Scheduler)£¬¿ÉÒÔÓÃ×ö¶¨Ê±Ö´ÐÐijЩÌض¨ÈÎÎñ£¨ÀýÈ磺ɾ³ý
¼Ç¼¡¢¶ÔÊý¾Ý
½øÐлã×ܵȵȣ©£¬À´È¡´ ......
¡¡¡¡ÊÂÎñÊÇDBMSµÃÖ´Ðе¥Î»¡£ËüÓÉÓÐÏÞµÃÊý¾Ý¿â²Ù×÷ÐòÁÐ×é³ÉµÃ¡£µ«²»ÊÇÈÎÒâµÃÊý¾Ý¿â²Ù×÷ÐòÁж¼ÄܳÉΪÊÂÎñ¡£Ò»°ãÀ´Ëµ£¬ÊÂÎñÊDZØÐëÂú×ã4¸öÌõ¼þ£º£¨ACID£©
¡¡¡¡Ô×ÓÐÔ£¨Autmic£©£ºÊÂÎñÔÚÖ´ÐÐÐÔ£¬Òª×öµ½“Ҫô²»×ö£¬ÒªÃ´È«×ö£¡”£¬¾ÍÊÇ˵²»ÔÊÐíÊÂÎñ²¿·ÖµÃÖ´ÐС£¼´Ê¹ÒòΪ¹ÊÕ϶øʹÊÂÎñ²»ÄÜÍê³É£¬ÔÚrollbackʱҲҪÏû³ý¶ÔÊ ......