thinkphpЧÀÍÆ÷Ôõô°²ÅÅ
thinkphpÊÇÒ»¸ö¿ªÔ´µÄphp¿ò¼Ü£¬ËüÒÔ¾«Á·¡¢¿ìËÙ¡¢Çå¾²µÄÌص㣬Ϊ¿ª·¢ÕßÌṩÁËÒ»¸ö¸ßЧÂʵĿª·¢Æ½Ì¨£¬ÒѾ³ÉΪphp¿ª·¢ÕßµÄÊ×Ñ¡¿ò¼ÜÖ®Ò»¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚЧÀÍÆ÷ÉÏ°²ÅÅthinkphp¿ò¼Ü¡£
×°ÖÃЧÀÍÆ÷ÇéÐÎ
Ê×ÏÈ£¬ÎÒÃÇÐèÒªÔÚЧÀÍÆ÷ÉÏ×°ÖÃWebЧÀÍÆ÷¡¢PHPºÍMySQLµÈÐëÒªµÄÇéÐΡ£³£¼ûµÄWebЧÀÍÆ÷ÓÐApacheºÍNginx£¬ÕâÀïÒÔApacheΪÀý¡£
ÔÚUbuntu²Ù×÷ϵͳÏ£¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´×°Öãº
sudo apt-get update sudo apt-get install apache2 sudo apt-get install php sudo apt-get install mysql-server
µÇ¼ºó¸´ÖÆ
ÏÂÔØThinkPHP¿ò¼Ü
ÔÚЧÀÍÆ÷ÉÏÏÂÔز¢½âѹËõThinkPHPµÄ×îа汾»òÕßÖ¸¶¨°æ±¾¡£½«½âѹËõºóµÄÎļþ¼Ð·ÅÔÚApacheµÄÖ¸¶¨Ä¿Â¼Ï£¨Ä¬ÒÔΪ/var/www/html/£©¡£
ÉèÖÃÊý¾Ý¿â
ÔÚMySQLÖн¨ÉèÒ»¸öеÄÊý¾Ý¿â£¬²¢Îª¸ÃÊý¾Ý¿â½¨ÉèÒ»ÕÅÊý¾Ý±í£¬ÓÃÓÚ´æ´¢Ó¦ÓóÌÐòËùÐèµÄÊý¾Ý¡£Í¨¹ýÒÔÏ´úÂëÅþÁ¬µ½MySQLÊý¾Ý¿â£º
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
//ÅþÁ¬MySQLÊý¾Ý¿â $conn = mysql_connect($host, $user, $password); //Ñ¡ÔñÊý¾Ý¿â mysql_select_db($database, $conn);
µÇ¼ºó¸´ÖÆ
ÉèÖÃÓ¦ÓóÌÐò
ÔÚThinkPHP¿ò¼ÜµÄ¸ùĿ¼Ï£¬ÓÐÒ»¸öconfig.phpÎļþ£¬ÓÃÓÚÉèÖÃÓ¦ÓóÌÐòµÄ²ÎÊý¡£·¿ª¸ÃÎļþ£¬ÐÞ¸ÄÆäÖеÄÊý¾Ý¿âÅþÁ¬ÐÅÏ¢ºÍÓ¦ÓóÌÐòµÄ¸ùĿ¼µÈÏà¹ØÐÅÏ¢¡£
ÉèÖÃApache
ÔÚApacheµÄÉèÖÃÎļþÖУ¬ÐèÒªÌí¼ÓÒ»¸öÖØд¹æÔò£¬½«ËùÓеÄURLÇëÇóÖض¨Ïòµ½Ó¦ÓóÌÐòµÄÈë¿Ú¾ç±¾¡£ÔÚUbuntuÖУ¬¸ÃÎļþλÓÚ/etc/apache2/sites-available/000-default.conf¡£ÔÚÎļþĩβÌí¼ÓÒÔÏÂÄÚÈÝ£º
<directory></directory> Options Indexes FollowSymLinks AllowOverride All Require all granted
µÇ¼ºó¸´ÖÆ
²âÊÔ
ÉèÖÃÍê³Éºó£¬ÎÒÃÇ¿ÉÒÔÔÚä¯ÀÀÆ÷ÖÐÊäÈëЧÀÍÆ÷µÄµØµã£¬Æ¾Ö¤Ó¦ÓóÌÐòµÄÈë¿Ú½ÅÔÀ´²âÊÔÓ¦ÓóÌÐòÊÇ·ñÀֳɰ²ÅÅ¡£ÈôÊÇÀֳɣ¬Äã¾Í¿ÉÒÔ×îÏÈ¿ª·¢ÄãµÄÓ¦ÓóÌÐòÁË¡£
×ܽá
ÔÚ±¾ÎÄÖУ¬ÎÒÃÇÏÈÈÝÁËÔõÑùÔÚЧÀÍÆ÷ÉÏ°²ÅÅThinkPHP¿ò¼Ü£¬²¢½¨ÉèÒ»¸ö¼òÆÓµÄÓ¦ÓóÌÐò¡£ÕâÊÇÒ»¸ö»ù´¡µÄ°²ÅÅÀú³Ì£¬ÈôÊÇÐèÒªÔ½·¢ÏêϸµÄ°²ÅÅÀú³Ì£¬¿ÉÒԲο¼¹Ù·½Îĵµ»òÕßÆäËû¿ª·¢ÕßµÄÂÄÀú·ÖÏí¡£
ÒÔÉϾÍÊÇthinkphpЧÀÍÆ÷Ôõô°²ÅŵÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡