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

Nginx + PHP + Mysql (php frm 방식)


Nginx + PHP + Mysql (php-frm 방식)

 글쓴이 :
최고관리자


조회 : 2,884  




테스트환경
CentOS 4.7, 5.3
(CentOS 5.3의 경우 pear에러가 났습니다. 해결방법도 첨부합니다.)

준비파일
* http://kr.php.net/get/php-5.2.10.tar.gz/from/this/mirror
* http://php-fpm.org/downloads/php-5.2.10-fpm-0.5.13.diff.gz
* http://www.nginx.eu/download/sources/nginx-0.7.61.tar.gz
* http://meteor.kr/linux/ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz

1. MySQL 설치
# yum install -y mysql mysql-server mysql-connector-odbc mysql-devel

서버의 상태에 따라 아래의 설정파일을 이용합니다

[MySQL 환경 설정]
my-huge.cnf
1G 이상 (시스템 메모리)
my-large.cnf
512M ~ 1G
my-medium.cnf
128M ~ 256M
my-small.cnf
64M 이하
# cp /usr/share/mysql/my-huge.cnf /etc/my.cnf
# mysql_install_db
# chown -R mysql:mysql /var/lib/mysql/
# /etc/rc.d/init.d/mysqld start
# mysqladmin -u root password "비밀번호"

2. 필요한 라이브러리 설치
# yum install -y libtool-ltdl-devel curl curl-devel libxml2
libxml2-devel libjpeg-devel libpng-devel libmcrypt libmcrypt-devel pcre
pcre-devel openssl openssl-devel
3. PHP & FPM 설치
# tar xvzf php-5.2.10.tar.gz
# gzip -cd php-5.2.10-fpm-0.5.13.diff.gz | patch -d php-5.2.10 -p1
# cd php-5.2.10
# CFLAGS=


Ïà¹ØÎĵµ£º

MySQL Êý¾Ý¿â³£ÓÃÃüÁî


1¡¢MySQL³£ÓÃÃüÁî
create database name; ´´½¨Êý¾Ý¿â
use databasename; Ñ¡ÔñÊý¾Ý¿â
drop database name Ö±½Óɾ³ýÊý¾Ý¿â£¬²»ÌáÐÑ
show tables; ÏÔʾ±í
describe tablename; ±íµÄÏêϸÃèÊö
select ÖмÓÉÏdistinctÈ¥³ýÖظ´×Ö¶Î
mysqladmin drop databasename ɾ³ýÊý¾Ý¿âÇ°£¬ÓÐÌáʾ¡£
ÏÔʾµ±Ç°mysql°æ±¾ºÍµ±Ç°ÈÕÆÚ
s ......

һЩ±»ºöÊ PHP º¯Êý£¨ÕûÀí£©

¿´
µ½ÕâƪÎÄÕÂ
£¬µ±Ê±¾ÍÀá±¼Á˺ü¸»Ø£¬ÖصãÍƼöÏ£¬Ë³±ãÎÒ×Ô¼ºÒ²×ö¸öÕûÀí¡£
sys_getloadavg()
Õâ¸öº¯Êý
·µ»Øµ±Ç°ÏµÍ³µÄ¸ºÔؾùÖµÐÅÏ¢
£¨µ±È» Windows
ϲ»ÊÊÓã©£¬ÏêϸÎĵµ¿ÉÒÔ·­ÔÄ PHP µÄÏà¹ØÎĵµ¡£ÎĵµÖÐÓжÎʾÀý´úÂ룬»ù±¾ÉÏÒ²¾ÍÄÜ¿´³öËüµÄÓÃ;ÁË¡£
<?php
$load = sys_getloadavg();
if ($load[0] > 80) ......

¡¶Head First Éè¼Æģʽ¡·´úÂëÖ®PHP°æ

¡¶Head First
Éè¼Æģʽ¡·ÊDZ¾²»´íµÄ½²½âÉè¼ÆģʽµÄÊ飬²»ÏñF4дµÄÄÇô¿ÝÔӦ¸ÃËãÊDZȽÏÈÝÒ×Àí½âµÄºÃÊé¡£ÊéÖеÄÀý×Ó¶¼±È½ÏdzÏÔÒ׶®£¬²»¹ýÓÉÓÚÊÇÍâ¹úÀÐдµÄ£¬ËùÒÔÀý×Ó
µÄÏ°¹ß²»ÊǺܸ½ºÏÖйúÌØÉ«£¬¿ÉÄÜż¶û¿´ÆðÀ´ÓÐЩ±ðŤ£¬»¹ÓÐÓïÑÔÏ°¹ßÒ²²»ÊÇÖйú·ç¡£µ±È»¿´¹ýÕâ±¾ÊéÖ®ºó£¬Äã²ÅÄÜÉî¿ÌÀí½âÉè¼Æģʽµ½µ×ÄÜΪÄã½â¾öÄÄЩ
퉣 ......

IIS+PHP+MYSQLÅäÖù¦ÂÔ

PHPµÄÖ´ÐÐЧÂÊÊÇÓÐÄ¿¹²¶ÃµÄ£¬ÕâÒ²ÊÇÎÒϲ»¶ËüµÄÔ­ÒòÖ®Ò»£¬ºÍËü³ÆΪ¾øÃî´îµµµÄMysqlÒÔ¼°ApacheÏëÈںϣ¬²»Äܲ»¾ªÌ¾ÆäЧÂÊÁË¡£PHP¸üÐÂÒ²ºÜ¿ì£¬ÕâÀïÁоÙÁËÄ¿Ç°×îа汾PHP4.3.2RC4£¨¼¸ºõûÓÐBUGÁË£¬¹À¼ÆдÍêÕâƪ²»¾ÃºóÕýʽ°æ¾Í³öÁË£©£¬ºÍ×îа汾µÄMysql4.0.13µÄ°²×°¹ý³Ì¡£   
¡¡¡¡PHPµÄ°²×°Îļþ¿ÉÒÔÖ±½Óµ½ &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ