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

php ·ÃÎÊ¿ØÖÆ

 <?php
// An array of allowed users and their passwords
$users = array(
'harryf' => 'secret',
'tom' => 'mypwd'
);
// If there's no Authentication header, exit
if (!isset($_SERVER['PHP_AUTH_USER'])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="PHP Secured"');
exit('This page requires authentication');
}
// If the user name doesn't exist, exit
if (!isset($users[$_SERVER['PHP_AUTH_USER']])) {
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="PHP Secured"');
exit('Unauthorized!');
}
// Is the password doesn't match the username, exit
if ($users[$_SERVER['PHP_AUTH_USER']] != $_SERVER['PHP_AUTH_PW'])
{
header('HTTP/1.1 401 Unauthorized');
header('WWW-Authenticate: Basic realm="PHP Secured"');
exit('Unauthorized!');
}
echo 'You\'re in!';
?>


Ïà¹ØÎĵµ£º

PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ

¡¡¡¡ËäÈ»PHPÊÇWebÓ¦Óÿª·¢ÖÐ×î¹ã·ºÊ¹ÓõĻ·¾³£¬µ«Ëü»¹ÊÇÒ»¶È±»ÈÏΪÎÞÔµÆóÒµ¼¶¿ª·¢¡£InfoQ×éÖ¯ÁËÒ»¸öÐéÄâ×ù̸С×éÀ´ÌÖÂÛÓïÑÔ/ƽ̨µÄÑݱ估PHPÔÚÆóÒµ»·¾³ÏµÄÊÊÓÃÐÔ¡£
¡¡¡¡Zeev Suraski£¬Zend Technologies¹«Ë¾´´Ê¼ÈË£¬¸Ã¹«Ë¾Ö÷Òª¹Ø×¢PHPµÄ½øÕ¹¡£
¡¡¡¡Rob Nicholson£¬¸ß¼¶¼¼ÊõÑÐÔ±, ÔøÎªIBM±àд¹ý³ÌÐòÉè¼ÆÓïÑÔÔËÐÐʱ¡£
¡¡¡ ......

PHP»º´æ¼¼Êõ£ºmemcacheº¯ÊýÏê½âÖ®Ò»

Memcacheº¯Êý¿âÊÇÔÚPECL(PHP Extension Community Library)ÖУ¬Ö÷Òª×÷ÓÃÊǴ´óÈÝÁ¿µÄÄÚ´æÊý¾ÝµÄÁÙʱ´æ·ÅÇøÓò£¬ÔÚ·Ö²¼Ê½µÄʱºò×÷ÓÃÌåÏֵķdz£Ã÷ÏÔ£¬·ñÔò²»½¨ÒéʹÓá£
memcacheº¯ÊýËùÓеķ½·¨ÁбíÈçÏ£º
²Î¿¼http://www.php.net/manual/zh/function.Memcache-add.php
Memcache::add - Ìí¼ÓÒ»¸öÖµ£¬Èç¹ûÒѾ­´æÔÚ£¬Ôò·µ»Øf ......

phpÒÔrootȨÏÞÖ´ÐеĽâ¾ö·½°¸Ö®Ò»

ÕâÖÖÎÊÌâÎÒÏë´ó¼Ò¿ÉÄܶ¼Óöµ½¹ý£¬ÍøÓÑÌṩµÄ½â¾ö·½·¨Ò²ºÜ¶à¡£ÎÒÒ²Ö»ÊǽáºÏ×Ô¼ºÏµÍ³µÄÐèÇó²¢½áºÏÍøÓѵĽâ¾ö·½°¸À´×ܽáµÄÒ»ÖÖ·½·¨
ÓÃÀ´×÷Ϊ½â¾öphpÒÔrootȨÏÞÖ´ÐÐһЩÆÕͨÓû§²»ÄÜÖ´ÐеÄÃüÁî»òÓ¦ÓõIJο¼¡£
ÆäʵphpÀïµÄpopen()º¯ÊýÊÇ¿ÉÒÔ½â¾öÕâ¸öÎÊÌâµÄ£¬µ«ÊÇÓÉÓÚijЩ°æ±¾µÄlinux(ÈçÎÒʹÓõÄCentos 5)¶Ôϵͳ°²È«µÄ¿¼ÂÇ£¬
ʹ ......

Ubuntu 9.04 server°²×°nginx+php(fastcgi)

 
×¼±¸ÖªÊ¶£º
Ubuntu  :
 Ubuntu ÊÇlinuxµÄÒ»¸ö°æ±¾£¬ÓзÇÖÞ·¢²¼µÄ£¬ÏÖÔڱȽÏÁ÷ÐеÄÒ»¸ö°æ±¾¡£
²Î¿¼°Ù¶È˵Ã÷Ubuntu
nginx ¡¡£º
Nginx ("engine x") ÊÇÒ»¸ö¸ßÐÔÄÜµÄ HTTP ºÍ ·´Ïò´úÀí ·þÎñÆ÷£¬Ò²ÊÇÒ»¸ö IMAP/POP3/SMTP ´úÀí·þÎñÆ÷¡£ Nginx ÊÇÓÉ Igor Sysoev Ϊ¶íÂÞ˹·ÃÎÊÁ¿µÚ¶þµÄ Rambler.ru Õ¾µã¿ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ