nginx + php + https ÅäÖÃÓÃÀý
#
Æô¶¯·þÎñµÄÓû§ºÍ×é
user
lighttpd lighttpd;
#
¿ª¶àÉÙ½ø³Ì
worker_processes
2;
#
´íÎóÈÕÖ¾
error_log
/data/log/nginx/nginx_error/nginx_error.log crit;
#
pid
pid
/var/run/nginx.pid;
#
Specifies
the value for maximum file descriptors that can be opened by this
process.
worker_rlimit_nofile
51200;
events
{
use
epoll;
worker_connections
51200;
}
http
{
#
¿ªÁ½ php-cgi ·þÎñ£¬¶Ë¿ÚÁ¬½Ó·½Ê½Ëٶȿ죬socket·½Ê½Îȶ¨
#
ʹÓÃ
lighttpd µÄ spawn-fcgi ÆðµÄfast-cgi
#
weight
ÊÇÉèÖÃȨÖØ
upstream phpfastcgi
{
server
unix:/tmp/php-fastcgi0.sock weight=1;
server
unix:/tmp/php-fastcgi1.sock weight=1;
#
server 127.0.0.1:8000
weight=1;
#
server 127.0.0.1:8001 weight=1;
}
#
mime ÀàÐÍ ºÍ ĬÈÏ header-type
include
mime.types;
default_type
application/octet-stream;
#
ĬÈÏ
header-charset
charset
utf-8;
#
һЩÏÞÖÆ
server_names_hash_bucket_size
128;
client_header_buffer_size
32k;
large_client_header_buffers
4 32k;
client_max_body_size
8m;
#
sendfile
Ó¦¸ÃÊÇ lighttpd µÄ sendfile ÊÇÒ»¸öÒâ˼
sendfile
on;
tcp_nopush
on;
keepalive_timeout
60;
tcp_nodelay
on;
#
fastcgi ÅäÖÃ
fastcgi_connect_timeout
300;
fa
Ïà¹ØÎĵµ£º
°²×° Nginx
* Ò»ÌõÃüÁî¸ã¶¨£º
USE=fastcgi emerge nginx
* н¨Óû§ºÍ×飺
groupadd www
useradd www -g www
Nginx °²×°ºÃºóĬÈÏ»áÌí¼Ó nginx ×éºÍ nginx Óû§£¬²»¹ýÎÒ±¾Éí»¹ÊÇÏ°¹ßн¨¸ö www ×éºÍ www Óû§À´×ö HTTP ·þÎñÓû§¡£Èô½ñºó HTTP ·þÎñÆ÷¸ü»»Îª apache »òÊÇ lighttpd ʱ£¬Óû§ÃûºÍÓû§×é¿ÉÒÔ²»±ä¡£
°²×° M ......
<?php
class DoubleQueue
{
public $queue = array();
/**£¨Î²²¿£©Èë¶Ó **/
public function push($value)
{
return array_push($this->queue,$value);
}
/**£¨Î²²¿£©³ö¶Ó**/
public function pop()
{
return array_pop($this->queu ......
±ÈÈçÒª¸øÓû§±¨¸æÒ»¸ö´íÎó£¬ÓÃÏÂÃæµÄ·½·¨£º
ʹÓÃset_error_handlerÉèÖÃ×Ô¼ºµÄ´íÎó´¦Àíº¯Êý£¬ÔÚ±¨´íµÄµØ·½Ê¹ÓÃtrigger_error£¬ÔÚ×Ô¶¨ÒåµÄ´íÎó´¦Àíº¯ÊýÖиøÓû§ÏÔʾһ¸ö³ö´íÐÅÏ¢Ò³Ãæ¡£
µ«
ÊÇÈç¹ûµ÷ÓÃtrigger_errorµÄÕâ¸öÒ³ÃæÊDZ»Ò»´ÎajaxÇëÇó´¥·¢µÄ£¬ÄÇôajax·µ»Øºó½«µÃµ½Ò»´ó¶ÑÓÃÓÚÏÔʾ´íÎóµÄhtml´úÂë¡£¶øÒ»°ã
ajaxµ÷Óö ......
ÕýÔò±í´ïʽ×Ô¼ºÒ»Ö±²»ÊìϤ£¬Õâ2ÌìÔÚÍøÉÏÒ»Ö±¿´¹ØÓÚËüµÄÎÄÕ£¬×Ô¼º×ܽáÁ˼¸¸öº¯Êý¡£
1£®preg_match()
º¯ÊýÔÐÍ£ºint preg_match (string $pattern, string $content [, array
$matches])
preg_match
()º¯ÊýÔÚ$content×Ö·û´®ÖÐËÑË÷Óë$pattern¸ø³öµÄÕýÔò±í´ïʽÏàÆ¥ÅäµÄÄÚÈÝ¡£Èç¹ûÌṩÁË$matches£¬Ôò½«Æ¥Åä½á¹û·ÅÈëÆäÖС ......