尊龙凯时人生就是博

linuxÏÂthinkphpÔõôÔËÐÐ

ÔÚ linux ƽ̨Ï £¬ÔõÑùÔËÐÐ thinkphp ÏîÄ¿ÄØ?

ThinkPHP ÊÇÒ»¸öºÜÊÇÓÅÒìµÄ PHP ¿ª·¢¿ò¼Ü¡£Ëü¼«´óµÄÌá¸ßÁË PHP ¿ª·¢Ð§ÂʺʹúÂëÖÊÁ¿ £¬Êܵ½ÁË¿í´ó¿ª·¢ÕßµÄÇàíù¡£¶øÔÚ Linux ƽ̨Ï £¬ÔõÑùÔËÐÐ ThinkPHP ÏîÄ¿ÄØ£¿ÏÂÃæ £¬Îª¸÷ÈËÏêϸÏÈÈÝ¡£

×°Öà PHP ÇéÐÎ

ÔÚ Linux ÏÂ×°Öà PHP ÇéÐκÜÊǼòÆÓ £¬Ö»ÐèÖ´ÐÐÒÔÏÂÏÂÁî¼´¿É£º

Ubuntu£º

sudo apt-get install php

Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡± £»

CentOS£º

yum install php

×°ÖÃ Apache »ò Nginx

ÔÚ Linux ϳ£ÓÃµÄ Web ЧÀÍÆ÷ÓÐ Apache ºÍ Nginx Á½ÖÖ £¬ÏÂÃæ»®·ÖÏÈÈÝÔõÑù×°Öá£

2.1 Apache ×°ÖÃ

Ubuntu£º

sudo apt-get install apache2

CentOS£º

yum install httpd

2.2 Nginx ×°ÖÃ

¹ØÓÚʹÓà Nginx µÄÓû§ £¬¿ÉÒÔÑ¡Ôñ×°Öà Nginx ²¢Ê¹Óà php-fpm Ä£¿éÖ´ÐÐ PHP ´úÂë £¬´ËÖÖ·½·¨Ð§ÂÊ½Ï Apache ¸ü¸ß¡£

Ubuntu£º

sudo apt-get install nginx php-fpm

CentOS£º

yum install nginx php-fpm

×°ÖÃ Composer

ThinkPHP 5 ½ÓÄÉ Composer ×÷Ϊ°ü¹ÜÀí¹¤¾ß £¬ÈôÊÇÒѾ­×°Öùý Composer £¬Ôò¿ÉÒÔÌø¹ý´Ë°ì·¨¡£

Ubuntu£º

sudo apt-get install composer

CentOS£º

curl -sS https://getcomposer.org/installer | php

mv composer.phar /usr/local/bin/composer

×°ÖÃ ThinkPHP

ÔÚ Linux Ï £¬×°Öà ThinkPHP ÓжàÖÖ·½·¨ £¬ÏÂÃæÏÈÈÝÁ½ÖÖ£ºComposer ×°ÖúÍÊÖ¶¯×°Öá£

4.1 Composer ×°ÖÃ

ÔÚÏÂÁîÐÐÖÐÖ´ÐÐÒÔÏÂÏÂÁ

composer create-project topthink/think tp5 –prefer-dist

ÆäÖÐ £¬tp5 ΪÏîÄ¿Ãû³Æ £¬–prefer-dist ÌåÏÖʹÓÃѹËõ°ü·½·¨×°Öá£

×°ÖÃÍê³Éºó £¬¼´¿Éͨ¹ýÏÂÁîÐÐÔÚÏîÄ¿¸ùĿ¼ÏÂÆô¶¯ PHP ÄÚÖà Web ЧÀÍÆ÷ £¬Ö´ÐÐÒÔÏÂÏÂÁ

php think run

4.2 ÊÖ¶¯×°ÖÃ

ÊÖ¶¯×°ÖÃÐèÒªÏȽ« ThinkPHP ÏÂÔز¢½âѹËõµ½Ö¸¶¨Ä¿Â¼ £¬È»ºóÉèÖÃÖØд¹æÔò£¨¿ÉʹÓà .htaccess »ò nginx.conf£© £¬ÉèÖÃÍê³Éºó¼´¿ÉÔËÐС£

ÉèÖÃÊý¾Ý¿â

ÔÚ Linux Ï £¬ThinkPHP ĬÈÏʹÓà MySQL Êý¾Ý¿â¡£ÐèÒªÔÚÉèÖÃÎļþÖÐÉèÖÃÊý¾Ý¿âÅþÁ¬ÐÅÏ¢¡£

ÔÚÏîÄ¿¸ùĿ¼Ï £¬·­¿ª application/database.php Îļþ £¬Ìîд׼ȷµÄÊý¾Ý¿âÅþÁ¬ÐÅÏ¢¼´¿É¡£

ÔËÐÐÏîÄ¿

ÉèÖÃÍê³Éºó £¬¼´¿Éͨ¹ý Web ä¯ÀÀÆ÷»á¼ûÏîÄ¿¡£

¹æÔò£ºhttp(s)://ÄãµÄÓòÃû»òÕßIP/ÏîÄ¿Ãû³Æ/Ä£¿éÃû/¿ØÖÆÆ÷Ãû/ÒªÁìÃû

ÀýÈ磺

http://localhost/tp5/index/index/hello

×ܽá

ÔÚ Linux ƽ̨Ï £¬×°ÖúÍÔËÐÐ ThinkPHP ÏîÄ¿²¢²»ÄÑÌâ £¬Ðè×¢ÖØÒÔϼ¸µã£º

×°Öà PHP ÇéÐÎ £»

×°ÖÃ Apache »ò Nginx £»

×°ÖÃ Composer £»

×°ÖÃ ThinkPHP £»

ÉèÖÃÊý¾Ý¿â £»

ÔËÐÐÏîÄ¿¡£

Ï£Íûͨ¹ý±¾ÎĵÄÏÈÈÝ £¬Äܹ»×ÊÖú¸÷È˸üºÃµØÔÚ Linux ϵͳÏÂÔËÐÐ ThinkPHP ÏîÄ¿¡£

ÒÔÉϾÍÊÇlinuxÏÂthinkphpÔõôÔËÐеÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í尊龙凯时人生就是博ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ尊龙凯时人生就是博ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是博

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
sitemap¡¢ÍøÕ¾µØͼ