UbuntuÏÂÅäÖÃLAMP£¨Linux+Apache+Mysql+PHP)»·¾³
ÖÕÓڷżÙÁË£¬ÕýÏëÔÚÕâ¸ö¼ÙÆÚÀïѧѧPHP£¬ÓÉÓÚ×Ô¼ºÓõÄÊÇ×ÀÃæ°æµÄUbuntu8.04,ÓÚÊǾÍÏë¼ÜÉèÒ»¸öLAMP»·¾³À´Ñ§PHP£¬Ò²³Ã´Ë»ú»áѧһÏÂPHP·þÎñÆ÷µÄ¼ÜÉè¡£
Ò»¡¢°²×°Ubuntu8.04
ËäȻ˵ÊÇÅäÖÃLAMP»·¾³£¬µ«ÔÚÎÄÕÂÀï²¢²»»á½²ÊöÈçºÎ°²×°Ubuntu8.04,ÒòΪ¹ØÓÚÈçºÎUbuntu8.04ÔÚÍøÉÏÒѾÓкܶàµÄ½Ì³ÌÁË£¬¾ÍËãÊÇÓ²ÅÌ°²×°Ò²ÊÇÒ»¼þºÜ¼òµ¥µÄÊÂÁË¡£ÕâÀïÎҾ͸ø³öÒ»¸öÁ´½ÓºÃÁË£¬Ubuntu8.04Ó²ÅÌ°²×°Ö¸ÄÏ£¬µ±È»£¬ÉÏÃæÕâƪÎÄÕÂÖ»ÊǸø³öÁË°²×°µÄÁ½ÖÖ·½·¨£¬Èç¹ûÄãÖØÀ´Ã»Óа²×°¹ýUbuntu£¬½¨ÒéÄãÔÚ°²×°Ç°ÏÈÈ¥¹Ù·½µÄÖÐÎÄWIKIÈ¥Á˽âÏÂÈçºÎ°²×°Ubuntu¡£
¶þ¡¢ApacheµÄ°²×°
Apache×÷Ϊһ¸ö¹¦ÄÜÇ¿´óµÄWeb³ÌÐò£¬×ÔÈ»ÊǼܽ¨Web·þÎñÆ÷µÄÊ×Ñ¡£¬ºÃÁË£¬ÏÂÃæÎÒÃǾÍÀ´°²×°Apache¡£ÔÚÖÕ¶ËÏÂÊäÈëÏÂÔÚÃæÃüÁ
sudo apt-get install apache2
°²×°Íê±Ïºó£¬½ÓÏÂÀ´¾ÍÒªÆô¶¯ApacheÁË
sudo /etc/init.d/apache2 restart
ÔÚä¯ÀÀÆ÷ÀïÊäÈëhttp://localhost»òÕßÊÇhttp://127.0.0.1£¬Èç¹û¿´µ½ÁË“It works!“£¬ÄǾÍ˵Ã÷Apache¾Í³É¹¦µÄ°²×°ÁË£¬ApacheµÄĬÈÏ°²×°£¬»áÔÚ/varϽ¨Á¢Ò»¸öÃûΪwwwµÄĿ¼£¬Õâ¸ö¾ÍÊÇWebĿ¼ÁË£¬ËùÓÐÒªÄܹýä¯ÀÀÆ÷·ÃÎʵÄWebÎļþ¶¼Òª·Åµ½Õâ¸öĿ¼Àï¡£
Èý¡¢PHPµÄ°²×°
ÔÚUbuntuÏ°²×°Èí¼þÊÇÒ»¼þ·Ç³£¼òµ¥µÄÊ£¬Ö»ÐèÒªÒ»¸öÃüÁî¾Í¿ÉÒÔÁË£¬ÔÚÖÕ¶ËÏÂÖ´ÐÐÏÂÃæµÄÃüÁ
sudo apt-get install libapache2-mod-php5 php5
°²×°Íêºó£¬ÎÒÃÇÒªÖØÐÂÆô¶¯Apache£¬ÈÃËü¼ÓÔØPHPÄ£¿é£º
sudo /etc/init.d/apache2 restart
½ÓÏÂÀ´£¬ÎÒÃǾÍÔÚWebĿ¼ÏÂÃæн¨Ò»¸öPHPÎļþÀ´²âÊÔPHPÊÇ·ñÄÜÕý³£µÄÔËÐУ¬ÃüÁ
sudo gedit /var/www/phpinfo.php
È»ºóÊäÈë:
<?php bloginfo(); ?> £¨×¢Ò⣺ʹÓÃʱ½«bloginfo»»³Éphpinfo£¬ÒòΪ·þÎñÆ÷µÄÏÞÖÆ£¬²»ÄÜʹÓÃphpinfoº¯Êý£©
½Ó×ű£´æÎļþ,ÔÚä¯ÀÀÆ÷ÀïÊäÈëhttp://127.0.0.1/phpinfo.php£¬Èç¹û³öÏÖÁËÒ»¸öÏÔʾPHPÔËÐвÎÊýµÄÒ³Ã棬ÄǾÍ˵Ã÷PHPÒѾÕý³£ÔËÐÐÁË¡£µ«ÊÇÈç¹ûûÓÐÏÔʾ³öÒ³Ã棬¶øÊÇÌáʾÄãÏÂÔØÎļþ£¬Õâ¾Í˵Ã÷ApacehûÓÐÕýÈ·¼ÓÔØPHPÄ£¿é£¬Õâʱ½â¾öµÄ·½·¨ÊÇ£¬ÔÚ/etc/apache2/apache2.conf »ò /etc/apache2/mods-enabled/php5.confÎļþÀï¼ÓÈëÏÂÃæµÄÒ»ÐÐÃüÁ
AddType application/x-httpd-php .php .phtml .php3
ÔÚ¼ÓÈëÉÏÃæµÄÃüÁîºó£¬ÔÙͨ¹ýÏÂÃæµÄÃüÁîÓ¦ÖØÆôApaceh¸Ã¾ÍÄܽâ¾öÎÊÌâÁË:
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 restart
ËÄ¡¢MySQLµÄ°²×°
sudo apt-get install mysql-server
ÔÚ°²×°µÄ×îºó£¬Ëü»áÒªÇóÀïÊäÈërootµÄÃ
Ïà¹ØÎĵµ£º
1£©±ÕÍø¿¨É豸
¡¡¡¡/sbin/ifconfig eth0 down
2£©ÐÞ¸ÄMACµØÖ·
¡¡¡¡/sbin/ifconfig eth0 hw ether 00:50:56:C0:00:01
3£©ÖØÆôÍø¿¨
¡¡¡¡/sbin/ifconfig eth0 up
ͨ¹ýifconfig¿ÉÒÔ¿´µ½ÐÞ¸ÄÒѾÉúЧ,¿ÉÊÇÖØÆô»úÆ÷ºóÓÖ»Ö¸´³ÉÁËÔÀ´µÃmac.
ÒªÏëÓÀ¾ÃÐÞ¸ÄMAC
ÔÚ/etc/rc.d/rc.localÀï¼ÓÉÏÕâÈý¾ä(Ò²¿ÉÒÔÔÚ/etc/init.d/networ ......
¡¾51CTO¾«Ñ¡ÒëÎÄ¡¿¶ÔÓÚLinux¹ÜÀíÔ±À´Ëµ£¬Óкܶà·Ç³£ÓÐÓõŤ¾ß¿É¹©Ñ¡Ôñ¡£ÔÚÕâÀÎÒÖ»ÊÇÁоٳöÆäÖÐ5¸ö£¬Linux¹ÜÀíÔ±ÈÕ³£²Ù×÷¶¼ÒªÓõ½µÄ¹¤¾ß¡£ÎÒÈÏΪ£¬¹¦ÄÜ×îÇ¿µÄ¹¤¾ß¿ÉÄܲ¢²»ÊʺÏÄãµÄʹÓÃÇé¿ö£¬¶øÇÒ¾ø¶ÔÓÐЩ¹¤¾ßÎÒ»¹ÍüÁË°ÑËüÃÇͳ¼Æ½øÀ´£¬Èç¹ûÊÇÕâÑùµÄ»°£¬ÎÒ¿ÒÇë´ó¼Ò°ÑÎÒûÊÕ¼µÄ¹¤¾ßÔÚÆÀÂÛÖÐд³öÀ´¡£ÁíÍ⣬±¾ÎÄÖÐÌáµ½µÄ¹¤¾ß ......
$pagesize=10; //ÉèÖÃÿһҳÏÔʾµÄ¼Ç¼Êý
$c("localhost","root",""); //Á¬½ÓÊý¾Ý¿â
$rs=mysql_query("select count(*) from tb_product",$conn); //È¡µÃ¼Ç¼×ÜÊý$rs
$myrow = mysql_fetch_array($rs);
$numrows=$myrow[0];
Ɍ ......
Ç°¶Îʱ¼äÈ¥Ò»¼Ò¹«Ë¾ÃæÊÔ£¬ÓÐÒ»µÀÌâÄ¿¾ÍÊÇ£ºÔõô°Ñ¸ø¶¨µÄÒ»¸ö×Ö·û´®ÄæÐò£¬×Ö·û´®ÖаüÀ¨ÖÐÎÄ
ÓÉÓÚµ±Ê±Ã»ÓлشðÉÏÀ´£¬ºóÀ´»Øµ½ÏÈѧУÈÏÕæÏëÁËÏ£¬Ò²ÔÚÍøÉÏÕÒÁËһЩ×ÊÁÏ£¬°´ËûÃǵķ½·¨È¥ÊµÏÖ£¬¿É½á¹û¶¼ÓÐÂÒÂ룡߯ÓôÃÆ£¬ÓÖ¹ýÁË»á¶ùÏë³öÀ´ÁËÕâ¸ö·½·¨ÈçÏ£º
------------------------------------------------------------------ ......