£ÛתÔØ£ÝUbuntuÏÂÅäÖÃPHP·þÎñÆ÷
±¾ÎÄתÔØ×Ô£ºhttp://www.binzhou123.com/article/html/6038.html
±õÖÝÕ¾³¤Íø×îÐÂÏûÏ¢£º
ApacheÊÇÒ»ÖÖ¹¦ÄÜÇ¿´óµÃWeb·þÎñÆ÷¡£Èç½ñ£¬InternetÉÏÎÞÊýÔËÐÐÔÚLinuxÉϵÃApache·þÎñÆ÷ÕýΪWebÊÀ½çµÃÈÕÒæ·±ÈÙÌṩ×ÅÓÐÁ¦µÃÖ§³Å¡£±¾ÎĽ«Ïò¶ÁÕß½éÉÜÈçºÎÔÚUbuntuLinuxϵͳѸËٴApacheWeb·þÎñÆ÷¡£
¾¡¹ÜUbuntuÊÇÒ»ÖÖÐÂÐ˵ÃLinux·ÖÖ§£¬µ«Ubuntu×é֯ȴΪApacheÌṩÁ˷ḻµÃÖ§³ÖÈí¼þ£¬ÕâЩÈí¼þ¶¼¿ÉÒÔ´Ó·¢ÐаæµÃ¹âÅÌ»ñÈ¡£¬Ò²¿ÉÒÔ´Ó¹Ù·½Õ¾µãÇáËÉÏÂÔØ¡£ËùÒÔ£¬Ubuntu·Ç³£ÊʺÏ×öΪWeb·þÎñÆ÷µÃƽ̨¡£
Ò»¡¢°²×°Apache
ÏÂÃ棬ÎÒÃÇÊ×ÏȽéÉÜÈçºÎ°²×°Apache¡£¾ßÌå°²×°ÃüÁîÈçÏÂËùʾ£º
$sudoapt-getinstallapache2
È»ºóÔËÐÐApache£¬ÃüÁîÈçÏÂËùʾ£º
$sudo/etc/init.d/apache2restart
ApacheÔÚ°²×°Æڼ佫»áн¨Ò»¸öĿ¼£º/var/www£¬¸ÃĿ¼ÊǸ÷þÎñÆ÷Öдæ·ÅÎĵµµÃ¸ùĿ¼¡£Ö»ÒªÔÚä¯ÀÀÆ÷µÃµØÖ·À¸ÊäÈëhttp://localhost/»ò»úÆ÷µÃIPµØÖ·¾ÍÄÜ·ÃÎÊ·ÅÖÃÔÚ´ËĿ¼ÖеÃËùÓÐÎĵµ¡£
¶þ¡¢°²×°PHP
PHPÊÇÒ»ÖÖÁ÷Ðе÷þÎñÆ÷¶Ë½Å±¾ÓïÑÔ£¬Ò»°ãÓëMySQL»òPostgres½áºÏÆðÀ´ÓÃÓÚ¹ÜÀíWebÄÚÈÝ¡¢blogºÍÂÛ̳¡£ÏÂÃæ½éÉÜÆä°²×°·½·¨£¬ÆäʵËüµÃ°²×°Ò²ºÜ¼òµ¥£¬ÃüÁîÈçÏÂËùʾ£º
$sudoapt-getinstalllibapache2-mod-php5
ÖØÐÂÆô¶¯ApacheÒÔ¼ÓÔØÉÏÃæ°²×°µÃÄ£¿é£º
$sudo/etc/init.d/apache2restart
ΪÁËÑéÖ¤PHPÄ£¿éÊÇ·ñÕýÈ·¼ÓÔØ£¬ÎÒÃÇ¿ÉÒÔ½¨Á¢Ò»¸öPHPÎļþ£¬È»ºó³¢ÊÔͨ¹ýWeb·þÎñÆ÷·ÃÎʸÃÎļþ¡£´ËÍ⣬ÎÒÃÇÖªµÀPHPÄÚ½¨ÁËÒ»¸öphpinfoº¯Êý£¬¸Ãº¯ÊýÄܹ»¸ø³öËüµÃ»·¾³µÃÏêϸÐÅÏ¢¡£ËùÒÔÎÒÃÇ»¹¿ÉÒÔÀûÓÃÏÂÃæµÃÃüÁîÀ´¼ì²éPHPµÃ¹¤×öÇé¿ö£º
sudosh-c"echo''>/var/www/info.php"
Ö®ºó£¬ÔÚä¯ÀÀÆ÷µØÖ·À¸¼üÈëhttp://localhost/info.php£¬È»ºó»Ø³µ£¬ÕâʱӦ¸ÃÄÜ¿´µ½Ò»¸öÑÕÃ棬¸ø³ö¸Õ²Å°²×°µÃPHPµÃÏêϸÐÅ
Ï¢¡£ÐèҪעÒâµÃÊÇ£¬Èç¹ûÔڴ˹ý³ÌÖÐä¯ÀÀÆ÷²»ÏÔʾҳÃ棬¶øÊÇÌáʾÄãÏÂÔØÎļþ£¬Õâ¾Í˵Ã÷ApacheûÓÐÕýÈ·¼ÓÔØPHPÄ£¿é¡£½â¾öÎÊÌâµÃ°ì·¨ÊÇ£¬ÔÚ/etc
/apache2/apache2.conf»ò/etc/apache2/mods-enabled/php5.confÎļþÖмÓÈëÏÂÃæÒ»ÐÐÃüÁ
AddTypeapplication/x-httpd-php.php.phtml.php3
¼ÓÈëÉÏÃæµÃÃüÁîÐкó£¬ÎªÁ˱£Ö¤ApacheÖØжÁÈ¡ÅäÖÃÎļþ¹Ø±Õ£¬ÎÒÃÇ¿ÉÒÔͨ¹ýÏÂÃæµÃÃüÁÆä¹Ø±Õ£¬È»ºóÔÙ¼ÓÒÔÆô¶¯£º
$sudo/etc/init.d/apache2stop
$sudo/etc/init.d/apache2start
Èý¡¢ÅäÖö¯Ì¬ÐéÄâÖ÷»ú
Ò»°ãÇé¿öÏ£¬ÎÒÃÇ»áÔÚWeb·þÎñÆ÷ÉϼķŶà¸öWebÕ¾µã£¬²¢ÇÒÿ¸öÕ¾µã¶¼ÓÐËü×Ô¼ºµÃÐéÄâ·þÎñÆ÷¡£¶ÔÓÚApacheÀ´Ëµ£¬ËüͬʱÖ
Ïà¹ØÎĵµ£º
<?php
function vCode($num=4,$size=20, $width=0,$height=0){
!$width && $width = $num*$size*4/5+5;
!$height && $height = $size + 10;
// È¥µôÁË 0 1 O l µÈ
$str = "23456789abcdefghijkmnpqrstuvwxyzABCDEFGHIJKLMNPQRSTUVW";
$code ......
×î½üÔÚGreg Beaver'sµÄblogÉÏ·¢±íµÄһƪÐÂÎÄÕ comparing strings in PHP with the == operator ÖÐÌá¼°ÁËPHPµÄ == ÔËËã·ûÔÚ¶Ô×Ö·û´®½øÐбȽÏʱֵµÃ×¢ÒâµÄÎÊÌâ¡£
ÔÚijЩÇé¿öÏ£¬PHP»á°ÑÀàÊýÖµÊý¾Ý£¨È纬ÓÐÊý×ÖµÄ×Ö·û´®µÈ£©×ª»»³ÉÊýÖµ´¦Àí£¬== ÔËËã·û¾ÍÊÇÆäÖÐÖ®Ò»¡£ÔÚʹÓà == ÔËËã·û¶ÔÁ½¸ö×Ö·û´®½øÐÐËÉÉ¢±È½Ïʱ£¬PHP»á°ÑÀàÊý ......
µ±ÄúÔËÐÐÒ»¸öÓ¦ÓóÌÐòʱ£¬Äú»á´ò¿ªËü£¬×öЩ¸ü¸Ä£¬È»ºó¹Ø±ÕËü¡£ÕâºÜÏñÒ»´Î»á»°¡£¼ÆËã»úÇå³þÄãÊÇË¡£ËüÖªµÀÄãºÎʱÆô¶¯Ó¦ÓóÌÐò£¬²¢ÔÚºÎʱÖÕÖ¹¡£µ«ÊÇÔÚÒòÌØÍøÉÏ£¬´æÔÚÒ»¸öÎÊÌ⣺·þÎñÆ÷²»ÖªµÀÄãÊÇËÒÔ¼°Äã×öʲô£¬ÕâÊÇÓÉÓÚ HTTP µØÖ·²»ÄÜά³Ö״̬¡£
ͨ¹ýÔÚ·þÎñÆ÷ÉÏ´æ´¢Óû§ÐÅÏ¢ÒÔ±ãËæºóʹÓã¬PHP session ½â¾öÁËÕâ¸öÎÊÌ⣨±ÈÈç ......
PHP×÷ΪһÖÖ·þÎñÆ÷¶ËµÄ½Å±¾ÓïÑÔ£¬Ïó±àд¼òµ¥£¬»òÕßÊǸ´ÔӵĶ¯Ì¬ÍøÒ³ÕâÑùµÄÈÎÎñ£¬ËüÍêÈ«Äܹ»Ê¤ÈΡ£µ«ÊÂÇé²»×ÜÊÇÈç´Ë£¬ÓÐʱΪÁËʵÏÖij¸ö¹¦ÄÜ£¬±ØÐë½èÖúÓÚ²Ù×÷ϵͳµÄÍⲿ³ÌÐò£¨»òÕß³Æ֮ΪÃüÁ£¬ÕâÑù¿ÉÒÔ×öµ½Ê°빦±¶¡£
ÄÇô£¬ÊÇ·ñ¿ÉÒÔÔÚPHP½Å±¾Öе÷ÓÃÍⲿÃüÁîÄØ£¿Èç¹ûÄÜ£¬ÈçºÎÈ¥×öÄØ£¿ÓÐЩʲô·½ÃæµÄ¹ËÂÇÄØ£¿ÏàÐÅÄã¿´Á˱¾ ......