WindowsÏ°²×°×îеÄApache+PHP+MySQLÖ¸ÄÏ
×¢Ò⣺֮ǰÎÒÔÚÍøÉÏÕÒÁ˺öàµÄ×ÊÁÏ NND¶¼²»ÄÜÕý³£ÅäÖóɹ¦ ¸ãµÃÎÒÊǷdz£µØÓôÃÆ£¡
ÕÒµ½ÕâƪÎÄÕÂÖ®ºóÎÒÖÕÓÚÅäÖóɹ¦ÁË£¡ÍÛºÃˬѽ£¡Ö»Òª°´ÕÕ ÉÏÃæµÄ²½Öè¾ÍÒ»¶¨Äܹ»³É¹¦µÄ£¡
´ËÎÄյݲװ·½·¨ÊÊÓÃÓÚ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 ÎÒ֮ǰÊÇÏÂÔØÁËÒ»¸öexe¸ñʽµÄ¹þ¹þ ÏÖÔÚÏÂÁËÒ»¸özip¸ñʽµÄ
* 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 ×ÓÄ¿Â
Ïà¹ØÎĵµ£º
ÅäÖû¹ÊǷdz£¼òµ¥µÄ£¬³ä·ÖÌåÏÖÁËnginxµÄÇ¿´óÓëÅäÖõļòµ¥^^ÏÂÃæÊÇ´óÖµķþÎñÆ÷½á¹¹Í¼£º
Ó¦ÓõÄ×îÇ°¶ËÊÇһ̨nginx·þÎñÆ÷£¬ËùÓо²Ì¬µÄÄÚÈݶ¼ÓÉnginxÀ´´¦Àí£¬¶ø½«ËùÓÐphpµÄÇëÇ󶼷Ö̯µ½ÏÂÓεÄÈô¸Ę́ÔËÐÐphp fastcgiÊØ»¤½ø³ÌµÄ·þÎñÆ÷ÖУ¬ÕâÑù¿ÉÒÔÒÔÒ»ÖÖÁ®¼ÛµÄ·½°¸À´ÊµÏÖ¶Ôϵͳ¸ºÔصķÖ̯£¬À©Õ¹ÏµÍ³µÄ¸ºÔØÄÜÁ¦¡£
Èý̨php fastc ......
<?php
// An array of allowed users and their passwords
$users = array(
'harryf' => 'secret',
'tom' => 'mypwd'
);
// If there's no Authentication header, exit
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic real ......
ÕâЩÌìÏë×÷Ò»¸öÔÚÍøÕ¾ÖÐʵÏÖ²å¼þµÄ¹¦ÄÜ£¬¹È¸èÁËһϣ¬·¢ÏÖһƪÎÄÕ¸оõ¶ÔÎÒ°ïÖúºÜ´ó£¬Ìû³öÀ´ºÍ´ó¼Ò·ÖÏí£¬·Ï»°²»¶à˵£¬Ö±½ÓÌû³ö´úÂ빩´ó¼Ò·ÖÎö£º
Ê×ÏÈÊDzå¼þµÄ¹ÜÀíÀàµÄʵÏÖ£º
<?
/**
* STBLOG PluginManager Class
*
* ²å¼þ»úÖƵÄʵÏÖºËÐÄÀà
*
* @package STBLOG
* @subpackage Libraries
* @ ......
mysql set names ÎÊÌâ
mysql_query("set names 'utf8'");
Ò»Ö±ÒÔÀ´×ÜÒÔΪset names ÊÇÓÃÀ´ÉèÖÃmsyql µÄ×Ö·û¼¯µÄ£¬×î½ü×÷¸ö¶«Î÷²Å·¢ÏÖ×Ô¼ºÈÏʶÉϵĴíÎó£¬
²éÒ»ÏÂÊÖ²á
SET NAMES ‘x‘Óï¾äÓëÕâÈý¸öÓï¾äµÈ¼Û£º
mysql> SET character_set_client = x;
mysql> SET character_set_results = x;
mysql> ......
¡¡¡¡
¡¡¡¡±¾ÎÄÖ÷Òª½éÉÜmysqlÊý¾Ý¿âÏÂshowÃüÁîµÄÖ÷ÒªÓ÷¨£º
¡¡¡¡a. show tables»òshow tables from database_name; -- ÏÔʾµ±Ç°Êý¾Ý¿âÖÐËùÓбíµÄÃû³Æ¡£
¡¡¡¡b. show databases; -- ÏÔʾmysqlÖÐËùÓÐÊý¾Ý¿âµÄÃû³Æ¡£
¡¡¡¡c. show columns from table_name from database_name; »òshow columns from database_name.table_n ......