ºìÁªLinuxÃÅ»§
Linux°ïÖú

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì

·¢²¼Ê±¼ä:2015-09-23 11:14:23À´Ô´:blog.csdn.net/xiong_it/×÷Õß:xiong_it

Õ⼸ÌìÊÖÉÏû»î£¬ÏëѧµãPHPʲôµÄ£¬¾Ý˵“PHPÊÇÊÀ½çÉÏ×îºÃµÄÓïÑÔ£¡”¡£ÄÇôÎÊÌâÀ´ÁË£ºÈçºÎ´î½¨PHP¿ª·¢»·¾³ÄØ£¿Windows¿ÉÑ¡ÔñWAMP¼¯³É°ü£¬Ò»¼ü°²×°£¬Linux/Ubuntuƽ̨ҲÓÐÀàËƵļ¯³É°ü£¬²»¹ýûװ³É£¬ÓÚÊDzÉÓÃÁË·Ö²½°²×°µÄ·½Ê½£¬Apache+Mysql+PHP·Ö¿ª°²×°¡£ÓÉÓÚÍøÉϵÄһЩ½Ì³Ì¶¼¹ýÆÚÁË£¬ºÜ¶à¶¼ÊÇÕë¶Ô¾É°æ±¾UbuntuдµÄ½Ì³Ì£¬±ÊÕ߶«Æ´Î÷´Õ£¬ÖÕÓÚÔÚUbuntu15.04/LinuxÉÏ´î³ÉÁËPHP¿ª·¢»·¾³-LAMP£¬×ܽáÔÚ´Ë£¬Ï£Íû¶Ô´ó¼ÒÓÐËù°ïÖú¡£


·Ö²½°²×°

°²×°apache2
°²×°php5
°²×°mysql-server
°²×°phpmyadmin


°²×°apache2

Ctrl+Alt+T×éºÏ¿ì½Ý¼ü¿É´ò¿ªUbuntuÖն˴°¿Ú£¬±¾ÎÄֻ˵һ±é¡£

sudo apt-get install apache2

ÊäÈëÃÜÂëºó¼´¿É°²×°£¬¼ì²éapache2°æ±¾

apache2 -v


Èç¹û°²×°ÁË¿É¿´µ½Èçͼ

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì

ÑéÖ¤ÊÇ·ñ°²×°³É¹¦£¬´ò¿ªä¯ÀÀÆ÷£¬µØÖ·À¸ÊäÈ룺ip¼´¿É¿´µ½Èçͼ£¨Èç¹ûÊDZ¾µØ°²×°ÇëÊäÈëµØÖ·http://localhost£©It works!£º

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì

Èç¹û¿´µ½ÁË°æ±¾µ«ÊÇûÓп´µ½“Apache2 Ubuntu Default Page”£¬ÇëÔÚÖÕ¶ËÖ´ÐÐ

sudo service apache2 restart

»òÕßÖ´ÐÐ

sudo /etc/init.d/apache2 restart


°²×°php5

sudo apt-get install php5 libapache2-mod-php5

ÉÏÃæͬʱ°²×°ÁËphp5Óëapache2µÄphpÄ£¿é£¬¹²Á½¸ö°ü¡£

ÑéÖ¤php5ÊÇ·ñ°²×°³É¹¦

sudo touch /var/www/html/testphp.php

×¢Ò⣺ÕâÒ»²½Â·¾¶ºÜÖØÒª£¬ÒòΪÔھɰ汾LinuxÖУ¬±ÊÕß»¹ÓÐÒ»¸öUbuntu12.04»·¾³µÄÐéÄâ»ú£¬ÊÇûÓÐhtmlÕâ¸öĿ¼µÄ£¬µ«ÊÇÔÚа汾Linux,±ÈÈç±¾ÎÄʹÓõÄUbuntu15.04»·¾³£¬°²×°apache2ºóĬÈÏ»áÉú³É/var/www/html/Õâ¸ö·¾¶¡£

vi /var/www/html/testphp.php

<?php
phpinfo();
>

ÉÏÃæÓõ½vi±à¼­Æ÷£¬Ã»ÓùýµÄ¿ÉÒԲο¼£ºhttp://blog.csdn.net/xiong_it/article/details/42278847
±£´æºó£¬ä¯ÀÀÆ÷·ÃÎÊ:http://localhost/testphp.php,¼´¿É¿´µ½ÈçÏÂͼ£ºÏÔʾ³öPHPµÄÐÅÏ¢ÄÚÈÝÒ³Ãæ

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì


°²×°mysql-server

sudo apt-get install mysql-server

°²×°¹ý³ÌÖлáÒªÇóÄãÊäÈëÁ½±émysqlµÄrootÓû§ÃÜÂ룬ÆäËûµØ·½Ö±½ÓÏÂÒ»²½¾ÍÐУ¬ÓÉÓÚÒѾ­°²×°ÁË£¬ÖØа²×°ÎÞÐèÅäÖÃÃÜÂ룬ËùÒÔÎÞ·¨½Øͼ³öÀ´£¬±§Ç¸¡£


°²×°phpmyadmin

³ýphp-myadminÍâÒª¸øËûװһЩÒÀÀµ

sudo apt-get install php5-mysql libapache2-mod-auth-mysql phpmyadmin

°²×°¹ý³ÌÖУ¬ÐèÒª£¬Ñ¡Ôñapache2£¬ÊäÈëµÄMySql¹ÜÀíÔ±ÃÜÂ룺Èçͼ

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì


×îºóÒ»²½
ÓÉÓÚhttp://localhost/ĬÈÏ·ÃÎÊ·¾¶ÊÇ/var/www/html/ ,ËùÒÔÐèÒª¸øphpmyadmin½¨Á¢ÈíÁ´½Óµ½htmlĿ¼ÏÂ

sudo ln -s /usr/share/phpmyadmin /var/www/html/phpmyadmin


ä¯ÀÀÆ÷·ÃÎÊ£ºhttp://localhost/phpmyadmin
´ó¹¦¸æ³É£¬ÉÏͼ£º

PHP£ºLinux/Ubuntu15.04´î½¨LAMP¿ª·¢»·¾³Í¼½â½Ì³Ì


ºÃÁË£¬php¿ª·¢»·¾³LAMP£¬ÐÂLinux/Ubuntu15.04ϵͳÏ´LAMP¿ª·¢»·¾³´î½¨¹¤×÷ÖÁ´ËÍê³É£¬ÀíÂÛÉÏUbuntu14.04ÊÇͨÓõģ¬Ã»ÊÔ¹ý£¬ÎÒÖ»ÓÐUbunut15.04ºÍUbuntu12.04»·¾³¡£ÎÒÏ£Íû×Ô¼ºÄÜÔÚ¿ªÔ´µÄµÀ·ÉÏÔ½×ßÔ½Ô¶¡£Ï£Íû±¾ÎĶԴó¼ÒÓÐËù°ïÖú¡£


ubuntu15.10°²×°lampp£ºhttp://www.linuxdiyf.com/linux/13197.html

ubuntu12.04&15.04°²×°lamp£¨12.04ΪÖ÷£©£ºhttp://www.linuxdiyf.com/linux/13087.html

CentOS/Debian/Ubuntuϵͳһ¼ü°²×°LNMP/LAMP/LNMPAÍøÕ¾»·¾³£ºhttp://www.linuxdiyf.com/linux/13084.html

Ubuntu Server 14.04°²×°LAMP£ºhttp://www.linuxdiyf.com/linux/11349.html