PHPÊÇʲô
PHP£¬Ò»¸öǶÌ×µÄËõдÃû³Æ£¬ÊÇÓ¢Îij¬¼¶Îı¾Ô¤´¦ÀíÓïÑÔ£¨PHP:Hypertext Preprocessor£©µÄËõд¡£PHP ÊÇÒ»ÖÖ HTML ÄÚǶʽµÄÓïÑÔ£¬PHPÓë΢ÈíµÄASPÆÄÓм¸·ÖÏàËÆ£¬¶¼ÊÇÒ»ÖÖÔÚ·þÎñÆ÷¶ËÖ´ÐеÄǶÈëHTMLÎĵµµÄ½Å±¾ÓïÑÔ£¬ÓïÑԵķç¸ñÓÐÀàËÆÓÚCÓïÑÔ£¬ÏÖÔÚ±»ºÜ¶àµÄÍøÕ¾±à³ÌÈËÔ±¹ã·ºµÄÔËÓá£PHP ¶ÀÌصÄÓï·¨»ìºÏÁË C¡¢Java¡¢Perl ÒÔ¼° PHP ×Ô´´ÐµÄÓï·¨¡£Ëü¿ÉÒÔ±È CGI »òÕß Perl ¸ü¿ìËÙµÄÖ´Ðж¯Ì¬ÍøÒ³¡£ÓÃPHP×ö³öµÄ¶¯Ì¬Ò³ÃæÓëÆäËûµÄ±à³ÌÓïÑÔÏà±È£¬PHPÊǽ«³ÌÐòǶÈëµ½HTMLÎĵµÖÐÈ¥Ö´ÐУ¬Ö´ÐÐЧÂʱÈÍêÈ«Éú³ÉHTML±ê¼ÇµÄCGIÒª¸ßÐí¶à£»ÓëͬÑùÊÇǶÈëHTMLÎĵµµÄ½Å±¾ÓïÑÔJavaScriptÏà±È£¬PHPÔÚ·þÎñÆ÷¶ËÖ´ÐУ¬³ä·ÖÀûÓÃÁË·þÎñÆ÷µÄÐÔÄÜ£»PHPÖ´ÐÐÒýÇ滹»á½«Óû§¾³£·ÃÎʵÄPHP³ÌÐòפÁôÔÚÄÚ´æÖУ¬ÆäËûÓû§ÔÙÒ»´Î·ÃÎÊÕâ¸ö³ÌÐòʱ¾Í²»ÐèÒªÖØбàÒë³ÌÐòÁË£¬Ö»ÒªÖ±½ÓÖ´ÐÐÄÚ´æÖеĴúÂë¾Í¿ÉÒÔÁË£¬ÕâÒ²ÊÇPHP¸ßЧÂʵÄÌåÏÖÖ®Ò»¡£PHP¾ßÓзdz£Ç¿´óµÄ¹¦ÄÜ£¬ËùÓеÄCGI»òÕßJavaScriptµÄ¹¦ÄÜPHP¶¼ÄÜʵÏÖ£¬¶øÇÒÖ§³Ö¼¸ºõËùÓÐÁ÷ÐеÄÊý¾Ý¿âÒÔ¼°²Ù×÷ϵͳ¡£
¡¡¡¡PHP ×î³õÊÇ1994ÄêRasmus Lerdorf´´½¨µÄ£¬¸Õ¸Õ¿ªÊ¼Ö»ÊÇÒ»¸ö¼òµ¥µÄÓÃPerlÓïÑÔ±àдµÄ³ÌÐò£¬ÓÃÀ´Í³¼ÆËû×Ô¼ºÍøÕ¾µÄ·ÃÎÊÕß¡£ºóÀ´ÓÖÓÃCÓïÑÔÖØбàд£¬°üÀ¨¿ÉÒÔ·ÃÎÊÊý¾Ý¿â¡£ÔÚ1995ÄêÒÔPersonal Home Page Tools (PHP Tools) ¿ªÊ¼¶ÔÍâ·¢±íµÚÒ»¸ö°æ±¾£¬LerdorfдÁËһЩ½éÉܴ˳ÌÐòµÄÎĵµ£¬²¢ÇÒ·¢²¼ÁËPHP1.0¡£ÔÚÕâÔçÆڵİ汾ÖУ¬ÌṩÁ˷ÿÍÁôÑÔ±¾¡¢·Ã¿Í¼ÆÊýÆ÷µÈ¼òµ¥µÄ¹¦ÄÜ¡£ÒÔºóÔ½À´Ô½¶àµÄÍøվʹÓÃÁËPHP£¬²¢ÇÒÇ¿ÁÒÒªÇóÔö¼ÓһЩÌØÐÔ£¬±ÈÈçÑ»·Óï¾äºÍÊý×é±äÁ¿µÈµÈ£¬ÔÚеijÉÔ±¼ÓÈ뿪·¢ÐÐÁÐÖ®ºó£¬ÔÚ1995ÄêÖУ¬PHP2.0·¢²¼ÁË¡£µÚ¶þ°æ¶¨ÃûΪPHP/FI(Form Interpreter)¡£PHP/FI¼ÓÈëÁ˶ÔmSQLµÄÖ§³Ö£¬´Ó´Ë½¨Á¢ÁËPHPÔÚ¶¯Ì¬ÍøÒ³¿ª·¢ÉϵĵØλ¡£µ½ÁË1996Äêµ×£¬ÓÐ15000¸öÍøվʹÓà PHP/FI£»Ê±¼äµ½ÁË1997ÄêÖУ¬Ê¹ÓÃPHP/FIµÄÍøÕ¾Êý×Ö³¬¹ýÎåÍò¸ö¡£¶øÔÚ1997ÄêÖУ¬¿ªÊ¼Á˵ÚÈý°æµÄ¿ª·¢¼Æ»®£¬¿ª·¢Ð¡×é¼ÓÈëÁË Zeev Suraski ¼° Andi Gutmans£¬¶øµÚÈý°æ¾Í¶¨ÃûΪPHP3¡£2000Ä꣬PHP4.0ÓÖÎÊÊÀÁË£¬ÆäÖÐÔö¼ÓÁËÐí¶àеÄÌØÐÔ¡£
PHPµÄÌØÐÔ
¡¡¡¡PHPµÄÌØÐÔ°üÀ¨£º
¡¡¡¡¿ª·ÅµÄÔ´´úÂ룺ËùÓеÄPHPÔ´´úÂëÊÂʵÉ϶¼¿ÉÒԵõ½¡£
¡¡¡¡PHPÊÇÃâ·ÑµÄ¡£
¡¡¡¡phpµÄ±ã½ÝÐÔ : phpÊ®·Ö±ã½Ý£¬Ñ§Ï°¼òµ¥
¡¡¡¡»ùÓÚ·þÎñÆ÷¶Ë£ºÓÉÓÚPHPÊÇÔËÐÐÔÚ·þÎñÆ÷¶ËµÄ½Å±¾,¿ÉÒÔÔËÐÐÔÚUNIX¡¢LINUX¡¢WINDOWSÏ¡£
¡¡¡¡Ç¶ÈëHTML£ºÒòΪPHP¿ÉÒÔǶÈëHTMLÓïÑÔ£¬ËùÒÔѧϰÆðÀ´²¢²»À§ÄÑ¡£
¡¡¡¡¼òµ¥µÄÓïÑÔ£ºPHP¼á³Ö½Å±¾ÓïÑÔΪÖ÷£¬ÓëJavaºÍC++²
Ïà¹ØÎĵµ£º
function getThumbs($filename,$savepath,$d_w,$d_h,$b,$img_name)
{
if($b)
{
$photourl = $savepath."/".$img_name;
}else
{
$photourl = ......
ÈÎÎñÐèÇó£ºÒ»¸ö»áÒéͶ¸åϵͳ£¬ÔÚ×÷ÕßÌá½»ÂÛÎÄժҪʱ×Ô¶¯Ïò×÷Õß·¢ËÍÒ»·âÈ·ÈÏÓʼþ¡£
(×¢£ºÍ¶¸åϵͳʹÓõÄÊÇmyreview
)
×Ðϸ¿¼ÂÇһϣ¬Õâ¸öÈÎÎñ¿ÉÒÔÓÐÒÔϼ¸ÖÖ·½Ê½Íê³É£º
ÔÚ·þÎñÆ÷ÉÏÅäÖÃsendmail·þÎñ£¬Ê¹ÓÃphpÖеĵÄmailº¯Êý·¢ËÍÓʼþ£»
ÔÚ·þÎñÆ÷ÉÏ°²×°mutt + msmtp£¬»òÕßÔÚ·þÎñÆ÷ÉÏ°²×°ÆäËüµÄsmtp¿Í»§¶Ë³ÌÐò£¬Ê¹ÓÃsmtp¿Í» ......
PHP³ÌÐòÔ±Ó¦¸Ã¶¼ÖªµÀÁ¬½ÓMySQLÊý¾Ý¿â¿ÉÒÔʹÓÃmysql_pconnect£¨ÓÀ¾ÃÁ¬½Ó£©º¯Êý£¬Ê¹ÓÃÊý¾Ý¿âÓÀ¾ÃÁ¬½Ó¿ÉÒÔÌá¸ßЧÂÊ£¬µ«ÊÇʵ¼ÊÓ¦ÓÃÖÐÊý¾Ý¿âÓÀ¾ÃÁ¬½ÓÍùÍù»áµ¼Ö³öÏÖһЩÎÊÌ⣬ͨ³£µÄ±íÏÖ¾ÍÊÇÔÚ´ó·ÃÎÊÁ¿µÄÍøÕ¾ÉÏʱ³£·¢Éú¶Ï¶ÏÐøÐøµÄÎÞ·¨Á¬½ÓÊý¾Ý¿âµÄÇé¿ö£¬³öÏÖÀàËÆ£¢Too many connections in ...£¢µÄ´íÎóÌáʾÐÅÏ¢£¬ÖØÐÂÆô¶¯·þÎñÆ÷Ó ......
ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«Ñ§Ï°ÈçºÎͨ¹ýPHP 5µÄÒ»¸ö»ù±¾³éÏóÀàʹÓÃÍâ¼üÔ¼ÊøÀ´¸üÐÂÁ½¸öInnoDB±íµÄÊý¾Ý¡£ ÎÒÃǽ«Í¨¹ý¾ßÌåʾÀýÀ´ËµÃ÷ÈçºÎͨ¹ý·þÎñÆ÷¶Ë½Å±¾ÓïÑÔÀ´Ê¹ÓÃÍâ¼üÔ¼Êø¡£
¡¡¡¡Ò»¡¢ÀûÓÃÍâ¼üÔ¼Êø¸üÐÂMySQLÖеÄÊý¾Ý
¡¡¡¡ÏÖÔÚ£¬×îÁ÷ÐеĿªÔ´¹ØϵÐÍÊý¾Ý¿â¹ÜÀíϵͳ·ÇMySQLĪÊô£¬¶øMySQLÓÖÖ§³Ö¶à¸ö´æ´¢ÒýÇ棬ÆäÖÐĬÈϵÄÒ²ÊÇËٶȽϿìµÄ´ ......
<?php
/*
Singleton && Registry Design Pattern Implementation
*/
class Registry {
private $_store = array();
public function getInstance() {
static $instance = array();
if (!$instance) {
$instance[0] = new ......