windows7Ï°²×°apache+php+mysqlÎÊÌâ¼Ç¼
×î½üÐÂÂòÁ˸öµçÄÔ£¬ÏµÍ³ÊÇwindows7£¬window7ÔÚ½çÃ棬¹¦ÄÜ·½Ã涼ͦÈÃÈËÂúÒâµÄ£¬¸Ð¾õºÜˬ£¬²»Ë¬µÄÊÇÓÖÒªÖØа²×°»·¾³ÁË¡£
ËùÓÐÈí¼þ¾ù°²×°ÔÚF:\server\ÏÂ
apacheĿ¼£ºF:\server\apache2.2
phpĿ¼£ºF:\server\php
msyqlĿ¼£ºF:\server\mysql
Ò»¡¢°²×°apache
°²×°apacheµÄ°æ±¾ÊÇ£ºhttpd-2.2.15-win32-x86-no_ssl.msi
°²×°¹ý³Ìû³öÏÖʲôÎÊÌ⣬°²×°³É¹¦ºó£¬ÎÒÐÞ¸ÄÁËÁËĬÈϵĸùĿ¼£ºDocumentRoot "F:/server/www"£¬·ÃÎÊhttp://localhost/³öÏÖYou don't have permission to access / on this server.µÄ´íÎ󡣺óÀ´Ò»²é£¬ÕÒµ½ÁË
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "DocumentRoot">
Õâôһ¶Î»°¡£
ÐÞ¸ÄÁËDocumentRootΪF:/server/www¾Í¸ã¶¨ÁË¡£
¶þ¡¢°²×°php
ÎÒÏÂÔصİ汾ÊÇ£ºphp-5.3.2-Win32-VC6-x86.zip
ÕâÀï˳±ã˵Ã÷Ï£¬VC6ÊDZíʾÓÃapache×÷Ϊweb·þÎñÆ÷£¬Èç¹ûÄãÊÇÓÃIIS£¬ÏÂÔØVC9µÄ¡£
ÐÞ¸Äphp.ini-developmentΪphp.ini£¬ÕâÀï×ö¿ª·¢Óã¬ËùÒÔÐÞ¸ÄÕâ¸ö¡£
Èý¡¢½áºÏapacheºÍphp
ÔÚapacheÅäÖÃÎļþÖÐÕÒµ½
# Example:
# LoadModule foo_module modules/mod_foo.so
#
ÔÚÏÂÃæ¼ÓÉÏ
LoadModule php5_module "F:/server/php/php5apache2_2.dll"
LoadFile F:/server/php/php5ts.dll
AddType application/x-httpd-php .php
PHPIniDir "F:/server/php"
È»ºóÖØÆôapache£¬¾Í¿ÉÒÔÕý³£·ÃÎÊphpÒ³ÃæÁË¡£
ËÄ¡¢°²×°mysql
ÎÒÏÂÔصİ汾ÊÇ£ºmysql-noinstall-5.1.45-win32.zip
1¡¢½âѹµ½F:\server\mysqlĿ¼ºó
2¡¢Ìí¼Ómysqlµ½ÏµÍ³·þÎñ¡£´ò¿ªcmd£¬ÔËÐÐF:\server\mysql\bin\mysqld.exe -install £¬ Ìáʾ°²×°³É¹¦¡£
3¡¢Æô¶¯mysql£¬ÔÚcmdÀïÔËÐÐnet start mysql £¬ mysqlÔËÐС£
4¡¢µÇ½mysql¹ÜÀí£¬ÔÚcmdÀïÔËÐÐF:\server\mysql\bin\mysql.exe -uroot -p £¬ÌáʾÊäÈëÃÜÂ룬²»ÓÃÊäÈ룬ֱ½Ó»Ø³µ£¨ÃÜÂëÊÇ¿Õ£©£¬´Ëʱ¾ÍµÇ½ÁËmysql¡£ËµÃ÷mysql·þÎñÕý³£¡£
Îå¡¢½áºÏphpºÍmsyql
±à¼php.ini£¬ÕÒµ½ ;extension=php_mysql.dll £¬ È¥µôÇ°ÃæµÄ·ÖºÅ
ÕÒµ½ ;extension_dir = "ext" , È¥µãÇ°ÃæµÄ·ÖºÅ¡£È»ºóÖØÆôapache¡£
±¾À´ÒÔΪÕâÑùÓ¦¸Ã¾ÍûÎÊÌâÁË¡£Ã»Ïëµ½³öÏÖ Call to undefined function mysql_connect() Õâ¸öÎÊÌâ¡£ÎÒÊ×ÏÈÈ·¶¨ÁË·½·¨mysql_connect()ûÓдò´íÃû³Æ¡£ÄÇôÔÒò¾ÍÊÇphp_mysql.dllÕâ¸öÀà¿âûÓмÓÔص½¡£¿´ÁËÍøÉϺܶà°ì·¨£¬ºóÀ´ÓÐÒ»ÌõÌáÐÑÁËÎÒ£¬»·¾³±äÁ
Ïà¹ØÎĵµ£º
(1) autoload»úÖƸÅÊö
ÔÚʹÓÃPHPµÄOOģʽ¿ª·¢ÏµÍ³Ê±£¬Í¨³£´ó¼ÒÏ°¹ßÉϽ«Ã¿¸öÀàµÄʵÏÖ¶¼´æ·ÅÔÚÒ»¸öµ¥¶ÀµÄÎļþÀÕâÑù»áºÜÈÝÒ×ʵÏÖ¶ÔÀà½øÐи´Óã¬Í¬Ê±½«À´Î¬»¤Ê±Ò²ºÜ±ãÀû¡£ÕâÒ²ÊÇOOÉè¼ÆµÄ»ù±¾Ë¼ÏëÖ®Ò»¡£ÔÚPHP5֮ǰ£¬Èç¹ûÐèҪʹÓÃÒ»¸öÀֻ࣬ÐèÒªÖ±½ÓʹÓÃinclude/require½«Æä°üº¬½øÀ´¼´¿É¡£ÏÂÃæÊÇÒ»¸öʵ¼ÊµÄÀý×Ó£º
CODE:
/* ......
½â¾ö·½·¨Ò»:(×îÖØÒªµÄÒ»ÖÖ·½·¨)
Äã¿´ÏÂmy.ini£¬ÓÐÎÞ
[mysql]
default-character-set=utf8
[client]
default-character-set=utf8
[mysqld]
default-character-set=utf8
È»ºó½¨Á¢±íʱ£¬Ò²ÒªÓ㨱ÈÈ磩
DROP TABLE IF EXISTS `Company`;
CREATE &nb ......
1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖظ´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âÇ°£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°ÈÕÆÚ
s ......
ÅäÖÃÖ÷´Ó£º
Á½Ì¨·þÎñÆ÷mysql°æ±¾Ò»Ñù£¬
Server version: 5.1.16-beta-log MySQL Community Server
ÅäÖûù±¾Ò»Ñù¡¢Æô¶¯²ÎÊýÒ»Ñù
Ö÷µÄ¿ÉÒÔ·ÃÎʴӵģ¬
µ«ÊÇ
´ÓÄDZßÔõôÁ¬½ÓÖ÷µÄ£¬¶¼ÊÇʧ°Ü£º
[root@2006 htmlfile]# mysql -h192.168.xx.xxx -uxxx -pxxx --default-character-set=GBK --reconnect
ERROR 2003 (HY000): C ......
dblpÊý¾Ý¿âÖÐÒýÓÃÐÅÏ¢ºÜÉÙ£¬Æ½¾ùһƪÂÛÎÄÒýÓÃ0.2ƪ¡£Ê¹ÓÃdblp×öʵÑéÊý¾Ý¼¯µÄijƪÂÛÎÄÌáµ½£¬¿ÉÒÔËæ»úÌí¼ÓÒýÓÃÐÅÏ¢¡£ÊÜ´ËÆô·¢£¬ÎÒ´òËãΪÿһƪÂÛÎĶ¼Ìí¼Ó20ƪËæ»úÒýÓã¬ÓÚÊǾÍд³öÁËÈçϵÄsqlÓï¾ä£º
String sql = "insert into citation(pId1,pId2) values( (selec ......