ASP.NET vs. PHP£¬Äĸö¸ü¿ì£¿
http://www.infoq.com/cn/news/2009/09/aspnet-php-benchmark
×÷Õß ÕÔ劼 ·¢²¼ÓÚ 2009Äê9ÔÂ15ÈÕ ÉÏÎç5ʱ33·Ö
ÉçÇø .NET Ö÷Ìâ ÐÔÄܺͿÉÉìËõÐÔ ±êÇ© PHP, ASP.NET
½áÂÛ£º
ÎÒÃÇ¿ÉÒÔÕâôÈÏΪ£¬¶ÔÓÚ´¿´âµÄPHPÖ´ÐÐÐÔÄÜÀ´Ëµ£¬LinuxºÍWindowsÏà²îÎÞ¼¸£¬Õâ²»»á³ÉΪѡÔñLinux»òWindows×÷Ϊ²¿Êðƽ̨µÄ¾ö¶¨ÐÔÒòËØ¡£
Èç¹ûÄãÔÚ¹¹½¨Ò»¸öÓ¦ÓóÌÐò£¬ÄÇôPostgreSQL¿ÉÄÜÊǸüºÃµÄÑ¡Ôñ¡£ÒòΪËüÔÚÁ½¸öƽ̨ÉϵıíÏÖ¶¼ºÜÓÅÐã¡£
Èç¹ûÄãµÄÓ¦ÓóÌÐò±ØÐëʹÓÃMySQL£¬ÄÇôѡÔñWindows¾ÍÐèÒªÔçЩ¼Æ»®À©Õ¹ÐÔÎÊÌâÁË£¨¸öÈËÈÏΪSun²»Ì«¿ÉÄÜΪWindowsÓÅ»¯MySQLµÄÐÔÄÜ£©¡£
PHPµÄµÚÒ»¸ö°æ±¾µÄSQL ServerÇý¶¯³ÌÐòÒª±ÈMySQL»òPostpreSQLÒªÂýһЩ£¬µ«ÕâÓ¦¸Ã²»»á³ÉΪÎÊÌâ¡£µÚ¶þ¸ö°æ±¾µÄÇý¶¯Æ÷ÕýÔÚ¿ª·¢Ö®ÖУ¬Ëü»á´øÀ´ÐÔÄÜÌáÉý¡£
----»ð÷è÷ë¸öÈ˾õµÃ²»¸ÃÓûº´æÀ´±È£¬»º´æµÄ¶¼ÊǾ²Ì¬Ò³Ã棬ÔÚ´óÁ¿ÍøÕ¾·ÃÎÊÏÂÓÐÓ㬵«ÊDZȽ϶¯Ì¬ÔËËãËٶȱȻº´æûÓÐÒâÒåµÄ
ÉϸöÔÂJoe StagnerÔÚ²©¿ÍÉÏ·¢±íÁËһϵÁÐÎÄÕ±ȽÏÁËPHPºÍASP.NETµÄÖ´ÐÐÐÔÄÜ£¬ÒýÆðÁËÀ´×ÔË«·½³ÌÐòÔ±µÄ´óÁ¿»ØÓ¦¡£Joe±íʾ£¬Ëû»á½«ÕâÑùµÄ²âÊÔ³ÖÐøÏÂÈ¥£¬²¢Ñ°Çó¸üΪºÏÊʵķ½Ê½£¬ÒÔ»ñµÃ¶ ......
ASP.NET vs. PHP£¬Äĸö¸ü¿ì£¿
http://www.infoq.com/cn/news/2009/09/aspnet-php-benchmark
×÷Õß ÕÔ劼 ·¢²¼ÓÚ 2009Äê9ÔÂ15ÈÕ ÉÏÎç5ʱ33·Ö
ÉçÇø .NET Ö÷Ìâ ÐÔÄܺͿÉÉìËõÐÔ ±êÇ© PHP, ASP.NET
½áÂÛ£º
ÎÒÃÇ¿ÉÒÔÕâôÈÏΪ£¬¶ÔÓÚ´¿´âµÄPHPÖ´ÐÐÐÔÄÜÀ´Ëµ£¬LinuxºÍWindowsÏà²îÎÞ¼¸£¬Õâ²»»á³ÉΪѡÔñLinux»òWindows×÷Ϊ²¿Êðƽ̨µÄ¾ö¶¨ÐÔÒòËØ¡£
Èç¹ûÄãÔÚ¹¹½¨Ò»¸öÓ¦ÓóÌÐò£¬ÄÇôPostgreSQL¿ÉÄÜÊǸüºÃµÄÑ¡Ôñ¡£ÒòΪËüÔÚÁ½¸öƽ̨ÉϵıíÏÖ¶¼ºÜÓÅÐã¡£
Èç¹ûÄãµÄÓ¦ÓóÌÐò±ØÐëʹÓÃMySQL£¬ÄÇôѡÔñWindows¾ÍÐèÒªÔçЩ¼Æ»®À©Õ¹ÐÔÎÊÌâÁË£¨¸öÈËÈÏΪSun²»Ì«¿ÉÄÜΪWindowsÓÅ»¯MySQLµÄÐÔÄÜ£©¡£
PHPµÄµÚÒ»¸ö°æ±¾µÄSQL ServerÇý¶¯³ÌÐòÒª±ÈMySQL»òPostpreSQLÒªÂýһЩ£¬µ«ÕâÓ¦¸Ã²»»á³ÉΪÎÊÌâ¡£µÚ¶þ¸ö°æ±¾µÄÇý¶¯Æ÷ÕýÔÚ¿ª·¢Ö®ÖУ¬Ëü»á´øÀ´ÐÔÄÜÌáÉý¡£
----»ð÷è÷ë¸öÈ˾õµÃ²»¸ÃÓûº´æÀ´±È£¬»º´æµÄ¶¼ÊǾ²Ì¬Ò³Ã棬ÔÚ´óÁ¿ÍøÕ¾·ÃÎÊÏÂÓÐÓ㬵«ÊDZȽ϶¯Ì¬ÔËËãËٶȱȻº´æûÓÐÒâÒåµÄ
ÉϸöÔÂJoe StagnerÔÚ²©¿ÍÉÏ·¢±íÁËһϵÁÐÎÄÕ±ȽÏÁËPHPºÍASP.NETµÄÖ´ÐÐÐÔÄÜ£¬ÒýÆðÁËÀ´×ÔË«·½³ÌÐòÔ±µÄ´óÁ¿»ØÓ¦¡£Joe±íʾ£¬Ëû»á½«ÕâÑùµÄ²âÊÔ³ÖÐøÏÂÈ¥£¬²¢Ñ°Çó¸üΪºÏÊʵķ½Ê½£¬ÒÔ»ñµÃ¶ ......
strip_tags
È¥µô HTML ¼° PHP µÄ±ê¼Ç¡£
Óï·¨: string strip_tags(string str);
·µ»ØÖµ: ×Ö·û´®
±¾º¯Êý¿ÉÈ¥µô×Ö·û´®Öаüº¬µÄÈκΠHTML ¼° PHP µÄ±ê¼Ç×Ö·û´®¡£ÈôÊÇ×Ö·û´®µÄ HTML ¼° PHP ±êÇ©ÔÀ´¾ÍÓÐ´í£¬ÀýÈçÉÙÁË´óÓڵķûºÅ£¬ÔòÒ²»á·µ»Ø´íÎ󡣶ø±¾º¯ÊýºÍ fgetss() ÓÐ×ÅÏàͬµÄ¹¦ÄÜ
//×¢
strip Ó¢[strip]
vi. 1. ÍѹâÒ·þ
vt. 1. °þÈ¥, ÍÑÈ¥2. °þ¶á, ¶á×ß ......
×î½ü¹«Ë¾ÓиöÍøÕ¾ÒªÏÈÅжϷþÎñÆ÷ÉϵÄÍøÒ³ÊÇ·ñ¿ÉÓã¬È»ºóÔÚ°ÑÖµÌá½»µ½Õâ¸öÍøÒ³ÉÏ¡£Ê¹ÓÃphpÀ´¼ì²âÍøÒ³ÊÇ·ñ¿ÉÓã¬Ã»Ôõô½Ó´¥¹ýphp£¬¸ãÁËÁ½Ì죬»ù±¾ÉÏÊÇ¿ÉÒÔ¼ì²âÁË¡£ÏÖ°Ñ´úÂëÌùÉÏ£º
<?php
//
$url = "http://blog.csdn.net/xuezhongsong/archive/2009/09/17/4561488.aspx";
$ctx = stream_context_create(array('http' => array('timeout' => 10)));
//»ñÈ¡ÍøÒ³ÄÚÈÝ
$result = @file_get_contents($url, 0, $ctx);
if($result){
echo "<Script language='JavaScript'> alert('³É¹¦£¡');</Script>";
}else{
echo "<script>alert('·þÎñÆ÷·±Ã¦£¬ÇëÉÔºóÔÙÊÔ!'); </script>";
}
//ÒÔÏÂÊÇÁíÒ»ÖÖ·½·¨ÅжϷþÎñÆ÷ÍøÒ³ÊÇ·ñÏìÓ¦£¬µ«Êǵ±±¾Ò³´¦Àíʱ¼ä³¬Ê±»áÓеãÎÊÌâ¡£
/*$fp = fsockopen("localhost", 80, &$errno, &$errstr, 10);
socket_set_timeout($fp, 0, 10);
if(!$fp && socket_set_timeout($fp, ......
Ç°Ò»ÕóдÁËÒ»¸ö¼òµ¥µÄÀ࣬½«session´æÈëÊý¾Ý¿â£¬µ±session_destroy()ʱ»á½«¿âÖеÄsession¼Ç¼ɾ³ý£¬¶ø¹ýÁËmaxlifetimeʱsession¼Ç¼ȴ»¹ÔÚ£¬µ±Ê±ºÜ²»Àí½â¡£
½ñÌìÓÖ¿´ÁËÏÂphp.ini£¬ÕÒµ½Á˹ØÓÚsessionµÄÅäÖã¬Ã÷°×ÁËÔÒò¡£
; Define the probability that the 'garbage collection' process is started
; on every session initialization.
; The probability is calculated by using gc_probability/gc_divisor,
; e.g. 1/100 means there is a 1% chance that the GC process starts
; on each request.
session.gc_probability = 1
session.gc_divisor = 1000
ÒÔÉÏÊÇĬÈÏÅäÖã¬Ò²¾ÍÊÇsession³õʼ»¯µÄʱºòÖ»ÓÐ1/1000µÄ¸ÅÂÊÆô¶¯GC process£¬Õâ¾ÍÊÇÔÒòËùÔÚ¡£
¸Ä±äÅäÖÃÈçÏ£º
session.gc_probability = 1
session.gc_divisor = 1
ÔÙÊÔÑéһϣ¬Êý¾Ý¿âÖг¬ÆÚµÄsession¼Ç¼ÿ´Î¶¼»áɾ³ýÁË£¬³É¹¦¡£
......
×î½ü×°Á˼¸´Îlinux£¬Ñ§Á˺ܶ࣬°Ñ¹ý³ÌдÏÂÀ´ÁË£¬Ï£Íû¸ø¿´µÄÈË°ïÖú£¬Ò²¶à¸øЩ½¨Òé¡£
Ò»¡¢Ñ¡Ôñ×îС»¯°²×°£¨Ê²Ã´Ò²²»Ñ¡£¬µ«ÊÇ»¹ÊÇÑ¡ÁËvim£©
¶þ¡¢Ê¹ÓùâÅÌ×÷ΪԴ°²×°£¨ÏêÇé²Î¼û/etc/yum.repos.d/CentOS-Media.repo£©ËùÓÃÌ×¼þ£¨Ê¹ÓÃyumµÄÇ¿´ó¹¦ÄÜ£©
####²¢²»ÊǼòµ¥µÄÓÃyumÃüÁÐèÒªÔÚyumºóÃæ¼ÓһЩ¶«Î÷£¬/etc/yum.repos.d/CentOS-Media.repoÀïÃæ˵Ã÷ÁË¡£
1.°²×°wget£¬man
yum install wget£¨±È½ÏÊìϤµÄ£©
2.°²×°cron
yum list | grep ''£¨²»Ì«ÊìϤ£©
yum install vixie-cron.i386
3.°²×°apache,php,mysql
£¨¿´ÁËÍøÉÏһЩ×ÊÁÏ£¬ÓеÄÊÇ×Ô¼º±àÒëµÄ£¬¿´ÁËcentosµÄÍøÕ¾£¬½¨ÒéʹÓÃyum°²×°£¬Õâ¸öÊǺÍredhatÒ»ÑùµÄ°æ±¾£¬Èç¹ûÒ»¶¨ÒªÊ¹ÓÃа汾£¬¿É²Î¿¼
http://wiki.centos.org/HowTos
/PHP_5.1_To_5.2?highlight=%28php%29|%28mcrypt%29£©
ÎÒÊÇÒÔ¹âÅÌ×÷ΪԴÓÃyum°²×°µÄ
1)
yum list | grep 'httpd'
yum install *****
2)
yum list | grep 'php' (ÓкܶàphpÀ©Õ¹)
yum install *****(Ñ¡Ôñ×Ô¼º°²×°µÄ£¬Ö§³ÖͨÅä·û)
3£©
yum list | grep 'mysql'
yum install *****
mysqladmin -u root -p 'yourpassword'£¨¸ømysqlÉèÃÜÂ룩
ÉèÖÿª»úÆô¶¯£º
chkconfig --level 35 ......
×î½ü×°Á˼¸´Îlinux£¬Ñ§Á˺ܶ࣬°Ñ¹ý³ÌдÏÂÀ´ÁË£¬Ï£Íû¸ø¿´µÄÈË°ïÖú£¬Ò²¶à¸øЩ½¨Òé¡£
Ò»¡¢Ñ¡Ôñ×îС»¯°²×°£¨Ê²Ã´Ò²²»Ñ¡£¬µ«ÊÇ»¹ÊÇÑ¡ÁËvim£©
¶þ¡¢Ê¹ÓùâÅÌ×÷ΪԴ°²×°£¨ÏêÇé²Î¼û/etc/yum.repos.d/CentOS-Media.repo£©ËùÓÃÌ×¼þ£¨Ê¹ÓÃyumµÄÇ¿´ó¹¦ÄÜ£©
####²¢²»ÊǼòµ¥µÄÓÃyumÃüÁÐèÒªÔÚyumºóÃæ¼ÓһЩ¶«Î÷£¬/etc/yum.repos.d/CentOS-Media.repoÀïÃæ˵Ã÷ÁË¡£
1.°²×°wget£¬man
yum install wget£¨±È½ÏÊìϤµÄ£©
2.°²×°cron
yum list | grep ''£¨²»Ì«ÊìϤ£©
yum install vixie-cron.i386
3.°²×°apache,php,mysql
£¨¿´ÁËÍøÉÏһЩ×ÊÁÏ£¬ÓеÄÊÇ×Ô¼º±àÒëµÄ£¬¿´ÁËcentosµÄÍøÕ¾£¬½¨ÒéʹÓÃyum°²×°£¬Õâ¸öÊǺÍredhatÒ»ÑùµÄ°æ±¾£¬Èç¹ûÒ»¶¨ÒªÊ¹ÓÃа汾£¬¿É²Î¿¼
http://wiki.centos.org/HowTos
/PHP_5.1_To_5.2?highlight=%28php%29|%28mcrypt%29£©
ÎÒÊÇÒÔ¹âÅÌ×÷ΪԴÓÃyum°²×°µÄ
1)
yum list | grep 'httpd'
yum install *****
2)
yum list | grep 'php' (ÓкܶàphpÀ©Õ¹)
yum install *****(Ñ¡Ôñ×Ô¼º°²×°µÄ£¬Ö§³ÖͨÅä·û)
3£©
yum list | grep 'mysql'
yum install *****
mysqladmin -u root -p 'yourpassword'£¨¸ømysqlÉèÃÜÂ룩
ÉèÖÿª»úÆô¶¯£º
chkconfig --level 35 ......
×î½ü×°Á˼¸´Îlinux£¬Ñ§Á˺ܶ࣬°Ñ¹ý³ÌдÏÂÀ´ÁË£¬Ï£Íû¸ø¿´µÄÈË°ïÖú£¬Ò²¶à¸øЩ½¨Òé¡£
Ò»¡¢Ñ¡Ôñ×îС»¯°²×°£¨Ê²Ã´Ò²²»Ñ¡£¬µ«ÊÇ»¹ÊÇÑ¡ÁËvim£©
¶þ¡¢Ê¹ÓùâÅÌ×÷ΪԴ°²×°£¨ÏêÇé²Î¼û/etc/yum.repos.d/CentOS-Media.repo£©ËùÓÃÌ×¼þ£¨Ê¹ÓÃyumµÄÇ¿´ó¹¦ÄÜ£©
####²¢²»ÊǼòµ¥µÄÓÃyumÃüÁÐèÒªÔÚyumºóÃæ¼ÓһЩ¶«Î÷£¬/etc/yum.repos.d/CentOS-Media.repoÀïÃæ˵Ã÷ÁË¡£
1.°²×°wget£¬man
yum install wget£¨±È½ÏÊìϤµÄ£©
2.°²×°cron
yum list | grep ''£¨²»Ì«ÊìϤ£©
yum install vixie-cron.i386
3.°²×°apache,php,mysql
£¨¿´ÁËÍøÉÏһЩ×ÊÁÏ£¬ÓеÄÊÇ×Ô¼º±àÒëµÄ£¬¿´ÁËcentosµÄÍøÕ¾£¬½¨ÒéʹÓÃyum°²×°£¬Õâ¸öÊǺÍredhatÒ»ÑùµÄ°æ±¾£¬Èç¹ûÒ»¶¨ÒªÊ¹ÓÃа汾£¬¿É²Î¿¼
http://wiki.centos.org/HowTos
/PHP_5.1_To_5.2?highlight=%28php%29|%28mcrypt%29£©
ÎÒÊÇÒÔ¹âÅÌ×÷ΪԴÓÃyum°²×°µÄ
1)
yum list | grep 'httpd'
yum install *****
2)
yum list | grep 'php' (ÓкܶàphpÀ©Õ¹)
yum install *****(Ñ¡Ôñ×Ô¼º°²×°µÄ£¬Ö§³ÖͨÅä·û)
3£©
yum list | grep 'mysql'
yum install *****
mysqladmin -u root -p 'yourpassword'£¨¸ømysqlÉèÃÜÂ룩
ÉèÖÿª»úÆô¶¯£º
chkconfig --level 35 ......
Ò»¡¢¸ÅÊö
ÒòΪ×î½üСÏîÄ¿±È½Ï¶à£¬¶øÇÒÏîÄ¿Ö®¼äµÄÖظ´¶ÈÓֱȽϴó£¬ËùÒÔ¸ãÁËÒ»¸öÏîÄ¿¿ò¼ÜËƵĶ«Î÷£¬±ß×ö±ßÐ޸ġ£
Ä¿Ç°ÀïÃæÒѾÈÝÄÉÁ˲»ÉÙ¼¸¸öÏîÄ¿£¬Ò²¸ãÁËЩÀàËÆ»ù´¡¹¹¼þÒ»ÑùµÄ¶«Î÷£º
flykobe@105 quick $ ls -FX
inc/ jzj/ m2/ mstatic/ t/ template/ webtools/ robots.txt*
default/ jbft_v2/ m/ modsky/ nba/ env_setting.inc* dispatch.php* clean.sh*
×ÓÏîÄ¿µÄ½á¹¹£º
flykobe@105 quick $ ls modsky/ -FX
control/ inc/ layout/ view/
ËùÓеÄURL¶¼¾¹ýdispatch.phpµÄ·ÓÉ£¬¾¹ýÒ»¶¨µÄ×Ö·û´®´¦Àí¹æÔò£¬Ö¸¶¨µ½×ÓÏîÄ¿controlÖеÄij¸öÎļþÉÏÈ¥¡£
¸ùĿ¼Ï£¬ÓÐһЩ¹«¹²µÄĿ¼£º
incÊÇÈ«ÌåÏîÄ¿¹«Óõĺ¯Êý¿â
mstaticÊÇһЩÁÙʱµÄcss¡¢jsÎļþÉú³ÉºóµÄ´æ·ÅλÖÃ
tÊDzâÊÔĿ¼
templateÊǹ«¹²Ä£¿é¿â
defaultÊÇһЩĬÈÏ·¾¶£¬ÆäÖаüÀ¨ÁËÏîÄ¿¹«¹²µÄajax½Ó¿Ú£¨µ±È»£¬Ã¿¸öÏîÄ¿Ò²¿ÉÒÔ¿ª·¢×Ô¼ºµÄajax½Ó¿Ú£©
ÁíÍ⣬env_setting.incÊÇÕû¸öÏîÄ¿µÄÅäÖÃÎļþ¡£
¶þ¡¢dispatch˵Ã÷
¿ªÊ¼µÄÏë·¨ÊÇ£¬ ......