thinkphpµ¼Èë½¹µãÎļþ±¨´í
ÔÚʹÓÃthinkphp¿ò¼Ü¾ÙÐпª·¢Ê±£¬¾³£ÐèÒªÒýÈëһЩ½¹µãµÄÎļþÀ´Íê³ÉһЩ»ù±¾²Ù×÷£¬ÀýÈçÊý¾Ý¿â²Ù×÷¡¢Â·ÓÉÆÊÎöµÈµÈ¡£È»¶ø£¬ÔÚÒýÈë½¹µãÎļþʱ£¬ÓÐʱ»áÓöµ½Ò»Ð©±¨´íÇéÐΣ¬²¢ÇÒÍùÍù¹ýʧÐÅÏ¢²¢²»·óÇåÎú£¬¸ø¿ª·¢´øÀ´ÁËÐí¶àÀ§ÈÅ¡£±¾ÎĽ«ÏÈÈÝÒ»ÖÖ³£¼ûµÄthinkphpµ¼Èë½¹µãÎļþ±¨´íµÄÇéÐΣ¬²¢ÌṩÏìÓ¦µÄ½â¾ö¼Æ»®¡£
ÎÊÌâÐÎò
ÔÚʹÓÃThinkPHP¿ò¼Ü¾ÙÐпª·¢Ê±£¬¾³£ÐèÒªÒýÈëһЩ½¹µãµÄÎļþÀ´Íê³ÉһЩ»ù±¾²Ù×÷£¬ÀýÈçÊý¾Ý¿â²Ù×÷¡¢Â·ÓÉÆÊÎöµÈµÈ¡£ÎÒÃÇͨ³£»áÔÚ¿ØÖÆÆ÷¡¢Ä£×Ó»òÕߺ¯ÊýÖÐʹÓÃÀàËÆÈçϵĴúÂëÒýÈë½¹µãÎļþ£º
require_once 'ThinkPHP/ThinkPHP.php';
µÇ¼ºó¸´ÖÆ
È»¶ø£¬ÔÚijЩÇéÐÎÏ£¬ÎÒÃÇ»áÓöµ½ÀàËÆÏÂÃæµÄ±¨´íÐÅÏ¢£º
Warning: require_once(ThinkPHP/ThinkPHP.php): failed to open stream: No such file or directory in /var/www/html/index.php on line 33 Fatal error: require_once(): Failed opening required 'ThinkPHP/ThinkPHP.php' (include_path='.:/usr/share/php') in /var/www/html/index.php on line 33
µÇ¼ºó¸´ÖÆ
Õâ¸ö¹ýʧÐÅÏ¢ÌåÏÖÔÚÒýÓÃThinkPHP½¹µãÎļþʱ·ºÆðÁËÎÊÌâ¡£ÏêϸÇéÐοÉÄÜÊÇÎļþ²»±£´æ»òÕßÎļþ·¾¶²»×¼È·¡£
Á¬Ã¦Ñ§Ï°¡°PHPÃâ·ÑѧϰÌõ¼Ç£¨ÉîÈ룩¡±£»
Ôµ¹ÊÔÓÉÆÊÎö
ÕâÖÖ¹ýʧͨ³£ÊÇÓÉÓÚÎļþ·¾¶²»×¼È·Ôì³ÉµÄ¡£ÔÚThinkPHP¿ò¼ÜÖУ¬½¹µãÎļþͨ³£Î»ÓÚThinkPHPĿ¼Ï¡£¿ÉÊÇ£¬ÔÚ²î±ðµÄÏîÄ¿ÖУ¬ThinkPHPĿ¼µÄλÖúÍÃû³Æ¿ÉÄÜÓÐËù²î±ð£¬Òò´ËÔÚʹÓÃrequire_onceÓï¾äÒýÈë½¹µãÎļþʱҪעÖØ·¾¶ÉèÖá£
½â¾ö¼Æ»®
Õë¶ÔÕâÖÖÇéÐΣ¬ÎÒÃÇ¿ÉÒÔ½ÓÄÉÒÔϼ¸ÖÖ½â¾ö¼Æ»®£º
¼ì²éÎļþ·¾¶
Ê×ÏÈ£¬ÎÒÃÇÐèÒª¼ì²éThinkPHPĿ¼µÄλÖÃÊÇ·ñ׼ȷ£¬²¢ÇÒÈ·±£ÎÒÃǵÄÒýÓ÷¾¶ÉèÖÃ׼ȷ¡£ÔÚʹÓÃrequire_onceÓï¾äʱ£¬¿ÉÒÔʹÓþø¶Ô·¾¶»òÕßÏà¶Ô·¾¶¡£
ÈôÊÇÎÒÃǵÄÏîÄ¿¸ùĿ¼ÖÐÓÐThinkPHPĿ¼£¬ÎÒÃÇ¿ÉÒÔʹÓÃÏà¶Ô·¾¶£º
require_once './ThinkPHP/ThinkPHP.php';
µÇ¼ºó¸´ÖÆ
ÈôÊÇÎÒÃǵÄÏîÄ¿ÖÐûÓÐThinkPHPĿ¼£¬ÎÒÃÇÐèҪʹÓþø¶Ô·¾¶£¬ÀýÈ磺
require_once '/var/www/html/ThinkPHP/ThinkPHP.php';
µÇ¼ºó¸´ÖÆ
¼ì²éÎļþȨÏÞ
ÓÐЩʱ¼ä£¬ÎļþȨÏÞ¿ÉÄÜ»áÒýÆð¹ýʧ¡£ÎÒÃÇÐèҪȷ±£ThinkPHPĿ¼ºÍÆäÖеÄÎļþȨÏÞ׼ȷ¡£¿ÉÒÔʹÓÃÈçϵÄÏÂÁîÐÞ¸ÄĿ¼ºÍÎļþµÄȨÏÞ£º
sudo chown -R www-data:www-data /var/www/html sudo chmod -R 755 /var/www/html
µÇ¼ºó¸´ÖÆ
ÆäÖУ¬www-dataΪApacheÔËÐеÄÓû§¡£ÈôÊÇÊÇÆäËûÔËÐÐÓû§£¬ÐèÒª×öÏìÓ¦µÄÐ޸ġ£
¼ì²éPHP°æ±¾
ÉÐÓÐÒ»ÖÖÇéÐÎÊÇPHP°æ±¾²»¼æÈÝ¡£ThinkPHP¿ò¼ÜÒªÇóPHP°æ±¾´óÓÚ5.3£¬Òò´ËÎÒÃÇÐèҪȷ±£PHP°æ±¾ÇкÏÒªÇ󡣿ÉÒÔʹÓÃÈçϵÄÏÂÁîÉó²éÄ¿½ñPHP°æ±¾£º
php -v
µÇ¼ºó¸´ÖÆ
ÈôÊÇPHP°æ±¾²»ÇкÏÒªÇó£¬ÐèÒªÉý¼¶PHP°æ±¾¡£
×ܽá
ÔÚʹÓÃThinkPHP¿ò¼Ü¾ÙÐпª·¢Ê±£¬¾³£ÐèÒªÒýÈëһЩ½¹µãµÄÎļþÀ´Íê³ÉһЩ»ù±¾²Ù×÷£¬ÀýÈçÊý¾Ý¿â²Ù×÷¡¢Â·ÓÉÆÊÎöµÈµÈ¡£È»¶ø£¬ÔÚÒýÈë½¹µãÎļþʱ£¬ÓÐʱ»áÓöµ½Ò»Ð©±¨´íÇéÐΣ¬²¢ÇÒÍùÍù¹ýʧÐÅÏ¢²¢²»·óÇåÎú¡£±¾ÎÄÏÈÈÝÁËÒ»ÖÖ³£¼ûµÄThinkPHPµ¼Èë½¹µãÎļþ±¨´íµÄÇéÐΣ¬²¢ÌṩÁËÏìÓ¦µÄ½â¾ö¼Æ»®¡£Í¨¹ý¼ì²éÎļþ·¾¶¡¢ÎļþȨÏÞºÍPHP°æ±¾µÈ·½Ã棬ÎÒÃÇ¿ÉÒÔÓÐÓõؽâ¾öÕâÖÖ±¨´íÇéÐΣ¬Ìá¸ß¿ª·¢Ð§ÂÊ¡£
ÒÔÉϾÍÊÇthinkphpµ¼Èë½¹µãÎļþ±¨´íµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡