1·ÖÖÓÍêÃÀ°²×°×îРCentOS + Nginx + PHP FPM + MySQL
PHP 5.3.1
MySQL 5.0.89
Nginx 0.8.33 »ò 0.7.65 £¨¿ÉÑ¡£©
ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔ¿ìËÙÈ«×Ô¶¯¸ã¶¨ CentOS + Nginx + PHP-FPM + MySQL µÄ°²×°ÁË
Õâ¸ö¿É±ÈÍøÉÏÁ÷´«µÄʲôһ¼ü°²×°°üÒªºÃµÃ¶à£¬Ç¿ÁÒÍƼö´Ë·¨°²×°£¬ÊʺÏËùÓвËÄñºÍ¸ßÊÖ
ÎÒ·þÎñÆ÷ÉÏÈ«ÓõÄÔ´´úÂë±àÒë°²×°£¬Ò²ºÃ²»µ½ÄÄÈ¥£¬»¹ºÜ·Ñ¾¢
ÎÒÕâ¸ö×°ÍêÒѾ°üº¬ php µÄһЩ³£ÓÃÀ©Õ¹, PDO,eaccelerator,memcache,tidyµÈµÈ
±¾ÎÄΪ 21andy.comÔ´´£¬×ªÔØÇëÒÔ³¬¼¶Á´½Ó·½Ê½×¢Ã÷³ö´¦ http://www.21andy.com
ÏÈн¨Ò»¸ö repo
# vi /etc/yum.repos.d/centos.21andy.com.repo
·ÅÈëÈçÏÂÄÚÈÝ
[21Andy.com]
name=21Andy.com Packages for Enterprise Linux 5 - $basearch
baseurl=http://www.21andy.com/centos/5/$basearch/
enabled=1
gpgcheck=0
protect=1
ÆôÓÃ EPEL repo
i386
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
x86_64
rpm -ihv http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
½Ó×ŵ¼Èëkey
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
ºÃÁË£¬Ò»¼ü°²×°
# yum install nginx php-fpm mysql-server
ˬ°É£¡
Èç¹û nginx ÄãÒªÓà 0.7.65 ×îÐÂÎȶ¨°æ£¬°Ñ
yum -y install nginx
»»³É
yum -y install nginx-stable
¾Í¿ÉÒÔÁË
±¾ÎÄΪ 21andy.comÔ´´£¬×ªÔØÇëÒÔ³¬¼¶Á´½Ó·½Ê½×¢Ã÷³ö´¦ http://www.21andy.com
¸üÍêÕûµÄ°²×°
yum -y update
yum -y mysql-server
service mysqld start
mysqladmin -u root password root
service mysqld stop
yum -y install nginx php-fpm php-cli php-pdo php-mysql php-mcrypt php-mbstring php-gd php-tidy php-xml php-xmlrpc php-pear php-pecl-memcache php-eaccelerator
# APC ºÍ eAccelerator ÓгåÍ»£¬2Ñ¡1
yum -y install php-pecl-apc
¿´ÏÂÎÒµÄÍêÕû°²×°£¬Ö»ÒªÒ»¾ä
yum
Ïà¹ØÎĵµ£º
±¾ÎÄÊʺÏCentOS¡£Ò»²½Ò»²½À´£¬²»Òª´í¡£
ÏÈÏÂÔع¤¾ßssh shell£¬¸öÈ˸оõÕâ¸ö±È½ÏºÃÓã¬ÍƼö¸ø´ó¼Ò
http://docs.isvps.net/soft/SSHSecureShellClient-3.2.9.zip
È»ºóÊÇһЩ±ØÒªµÄÈí¼þ°ü
nginxÔ´Âë°ü: http://www.nginx.org/download/nginx-0.7.65.tar.gz
phpÔ´Âë°ü: http://cn.php.net/distributions/php-5.2.11.tar.gz ......
¸ù¾ÝÄãµÄʹÓÃÄ¿µÄÎÒ¾õµÃÕâ¸öº¯ÊýÓÐÁ½·½ÃæµÄÓÃ;£º
·ÀÖ¹SQL Injection¹¥»÷£¬Ò²¾ÍÊÇÄã±ØÐëÑéÖ¤Óû§µÄÊäÈë
²Ù×÷Êý¾ÝµÄʱºò±ÜÃâ²»±ØÒªµÄ×Ö·ûµ¼Ö´íÎó
mysql_real_escape_string() º¯ÊýתÒå SQL Óï¾äÖÐʹÓõÄ×Ö·û´®ÖеÄÌØÊâ×Ö·û¡£
ÏÂÁÐ×Ö·ûÊÜÓ°Ï죺
\x00
\n
\r
\
'
"
\x1a
Èç¹û³É¹¦£¬Ôò¸Ãº¯Êý·µ»Ø±»×ªÒåµÄ×Ö·û´ ......
PHPÊý×麯ÊýÖÐòËÆûÓÐÌṩɾ³ýÊý×éÖеÄij¸öÔªËصĺ¯Êý
µ«È´ÓÐÒ»¸öarray_search£¨²éÕÒÊý×éÖеÄij¸öÔªËØ£¬²¢·µ»ØÆä¼üÃû£©
ÄÇô¾ÍÓÃÒ»ÏÂËüÁË
$array_key = array_search($target_value,$target_array);
if($array_key||$array_key==0)unset($target_array[$target_value]);
//ÕâÀïµÄÌõ¼þÓÃ$array_key!==falseÒ²ÊÇ¿ÉÒԵİ ......
Ä¿Ç°LAMP (Linux + Apache + MySQL + PHPspan style="font-family: Verdana;">) ½ü¼¸ÄêÀ´·¢Õ¹Ñ¸ËÙ£¬ÒѾ³ÉΪWeb ·þÎñÆ÷µÄÊÂʵ±ê×¼¡£LAMPÕâ¸ö´ÊµÄÓÉÀ´×îÔçʼÓڵ¹úÔÓÖ¾“c't Mag
azine”£¬Michael KunzeÔÚ1990Äê×îÏÈ°ÑÕâЩÏîÄ¿×éºÏÔÚÒ»Æð´´ÔìÁËLAMPµÄËõд×Ö¡£ÕâЩ×é¼þËäÈ»²¢²»ÊÇ¿ª¿ªÊ¼¾ÍÉè¼ÆΪһÆðʹ ......
PHP µÄÕæÕýÍþÁ¦Ô´×ÔÓÚËüµÄº¯Êý¡£
ÔÚ PHP ÖУ¬ÌṩÁ˳¬¹ý 700 ¸öÄÚ½¨µÄº¯Êý¡£
PHP º¯Êý
ÔÚ±¾½Ì³ÌÖУ¬ÎÒÃǽ«ÎªÄú½²½âÈçºÎ´´½¨×Ô¼ºµÄº¯Êý¡£
ÈçÐèÄÚ½¨º¯ÊýµÄ²Î¿¼ºÍʵÀý£¬Çë·ÃÎÊÎÒÃÇµÄ PHP ²Î¿¼Êֲᡣ
´´½¨ PHP º¯Êý
º¯ÊýÊÇÒ»ÖÖ¿ÉÒÔÔÚÈκα»ÐèÒªµÄʱºòÖ´ÐеĴúÂë¿é¡£
´´½¨ PHP º¯Êý£º
ËùÓеĺ¯Êý¶¼Ê¹Óùؼü´Ê "function( ......