×ðÁú¿­Ê±

²î±ðÇéÐÎÏÂthinkphpÓ¦¸Ã·ÅÔÚÄÇÀï

ÔÚ¿ª·¢webÓ¦ÓóÌÐòµÄʱ¼ä £¬ÎÒÃǾ­³£Ê¹ÓóÉÊìµÄphp¿ò¼ÜÀ´¼ÓËÙÏîÄ¿µÄ¿ª·¢ £¬ÆäÖÐthinkphpÊÇÒ»¸öÆÕ±éʹÓõĿò¼ÜÖ®Ò»¡£È»¶ø £¬Ðí¶à³õѧÕß²»ÖªµÀthinkphpÓ¦¸Ã·ÅÔÚÄÇÀï²Å»ªÈÃÆäÕý³£ÊÂÇé¡£±¾ÆªÎÄÕ½«ÏÈÈÝÔÚ²î±ðÇéÐÎÏÂthinkphpÓ¦¸Ã·ÅÔÚÄÇÀï £¬ÒÔ¼°ÔõÑùÉèÖÃÆä·¾¶ÐÅÏ¢¡£

Ò»¡¢ÍâµØÇéÐÎ

ÔÚÍâµØÇéÐÎÏ £¬ÎÒÃÇͨ³£Ê¹ÓÃXAMPP¡¢WAMPµÈ¼¯³É¿ª·¢ÇéÐÎ £¬½«Apache WebЧÀÍÆ÷ºÍPHPÇéÐδò°üÔÚÒ»Æð¡£ÔÚÕâÖÖÇéÐÎÏ £¬ÎÒÃÇ¿ÉÒÔ½«thinkphpÎļþ¼ÐÖ±½Ó°²ÅÅÔÚWebЧÀÍÆ÷µÄ¸ùĿ¼Ï £¬ÀýÈçXAMPPÖеÄhtdocsĿ¼ £¬WAMPÖеÄwwwĿ¼µÈ¡£ÕâÑù £¬ÎÒÃǾͿÉÒÔÔÚä¯ÀÀÆ÷ÖÐͨ¹ýlocalhost»ò127.0.0.1À´»á¼ûÍøÕ¾¡£±ðµÄ £¬ÈôÊÇÄúµÄÏîÄ¿ÐèҪʹÓÃÊý¾Ý¿â £¬Äú»¹ÐèÒªÔÚphpMyAdminµÈÊý¾Ý¿âÖÎÀí¹¤¾ßÖн¨ÉèÒ»¸öÊý¾Ý¿â £¬²¢ÔÚÄúµÄ³ÌÐòÖÐͨ¹ýÉèÖÃÎļþÅþÁ¬µ½¸ÃÊý¾Ý¿â¡£

¶þ¡¢ÐéÄâÖ÷»ú

ÔÚ¹²ÏíÖ÷»ú»òÕßVPS£¨ÐéÄâרÓÃЧÀÍÆ÷£©ÉÏ £¬ÎÒÃÇͨ³£Ê¹ÓÃÐéÄâÖ÷»úÀ´ÍйÜÍøÕ¾¡£Æ¾Ö¤ÐéÄâÖ÷»úµÄ²î±ðÉèÖà £¬PHPÎļþµÄ´æ·ÅλÖÃÒ²»áÓÐËù²î±ð¡£Ò»Ñùƽ³£À´Ëµ £¬ÐéÄâÖ÷»úµÄÎĵµ¸ùĿ¼ÊǸÃÖ÷»úÏÂËùÓÐÍøÕ¾µÄ¹«¹²¸ùĿ¼ £¬Ò²³ÆΪÖ÷Ŀ¼£¨home directory£©¡£¼ÙÉèÄãÐèÒª½«thinkphp·ÅÔÚÒ»¸öÃûΪmyappµÄ×ÓĿ¼Ï £¬Äã¿ÉÒÔ½«Õû¸öthinkphpÎļþ¼ÐÉÏ´«µ½myappĿ¼Ï £¬È»ºóÔÚ¸ÃĿ¼Ï½¨ÉèÒ»¸öindex.phpÎļþ £¬ÄÚÈÝÈçÏ£º

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

<?php define('APP_PATH', __DIR__ . '/../thinkphp/');
define('BIND_MODULE','index');
require __DIR__ . '/../thinkphp/start.php';

µÇ¼ºó¸´ÖÆ

ÔÚÕâÀï £¬ÎÒÃÇͨ¹ýdefineº¯Êý½ç˵ÁËAPP_PATH³£Á¿ £¬ËüÖ¸ÏòÁËthinkphpÎļþ¼ÐµÄÉϼ¶Ä¿Â¼¡£È»ºó £¬ÎÒÃǽ«ÔËÐÐindexÄ£¿é £¬²¢Í¨¹ýstart.phpÎļþÆô¶¯ÁËÕû¸ö¿ò¼Ü¡£ÕâÑù £¬ÎÒÃǾͿÉÒÔÔÚä¯ÀÀÆ÷ÖÐͨ¹ý»á¼ûhttp://ÄãµÄÓòÃû/myappÀ´»á¼ûÍøÕ¾¡£

¸ü½øÒ»²½ £¬ÈôÊÇÄãÐèҪΪ²î±ðµÄÓ¦ÓóÌÐò½¨Éè²î±ðµÄ×ÓĿ¼ £¬Äã¿ÉÒÔ½«Ã¿¸öÓ¦ÓóÌÐòµÄÖ÷Ŀ¼ÉèÖÃΪ¸ÃĿ¼ÏµÄpublicĿ¼¡£Ò²¾ÍÊÇ˵ £¬ÄãÐèÒªÔÚÿ¸öÓ¦ÓóÌÐòÖн¨ÉèÒ»¸öpublicĿ¼ £¬½«ÄãµÄÓ¦ÓóÌÐòµÄÈë¿ÚÎļþ·ÅÔÚÆäÖÐ £¬È磺

/project1
    /application
        /controller
        /model
        /view
        /...
    /public
        /index.php
        /assets
            /css
            /js
            /images
            /...
        /...
/project2
    /application
    /public
        /index.php
/project3
    /application
    /public
        /index.php

µÇ¼ºó¸´ÖÆ

ÕâÊÇÒ»¸ö½ÏÁ¿Í¨Óõķ½·¨ £¬ÓÉÓÚpublicĿ¼ÖеÄËùÓÐÄÚÈݶ¼¿ÉÒÔͨ¹ýWebЧÀÍÆ÷Ö±½Ó»á¼û £¬¶øapplicationĿ¼ÖеĴúÂëÎļþÔò²»¿É±»Ö±½Ó»á¼û¡£

Èý¡¢Ô¶³ÌЧÀÍÆ÷

ÔÚÔ¶³ÌЧÀÍÆ÷ÉÏÍйÜÄúµÄÓ¦ÓóÌÐòʱ £¬Ç뽫Æä·ÅÔÚ¹«¹²Ä¿Â¼Ï¡£ÈôÊÇÄúʹÓõÄÊÇLinuxЧÀÍÆ÷ £¬Äú¿ÉÒÔ½«thinkphpÎļþ¼ÐÖ±½Ó·ÅÔÚ/var/www/htmlĿ¼Ï¡£ÈôÊÇÄúʹÓõÄÊÇWindowsЧÀÍÆ÷ £¬Ôò¿ÉÒÔ½«Æä·ÅÔÚC:\inetpub\wwwrootĿ¼Ï¡£ËäÈ» £¬ÈôÊÇÄúʹÓõÄÊÇ×Ô¼º´î½¨µÄÐéÄâÖ÷»úЧÀÍÆ÷ £¬Ôò¿ÉÒÔƾ֤ÄúÔÚÐéÄâÖ÷»ú¿ØÖÆÃæ°åÖÐÉèÖõÄĿ¼À´È·¶¨Ó¦ÓóÌÐòµÄ´æ·ÅλÖá£

ÔÚÔ¶³ÌЧÀÍÆ÷ÉÏ £¬Äú»¹ÐèÒªÉèÖÃthinkphp·¾¶ÐÅÏ¢ÒÔÈ·±£¿ò¼ÜÄܹ»Õý³£ÔËÐС£¼ÙÉèÄú½«¿ò¼ÜĿ¼·ÅÔÚÁË/var/www/html/thinkphpÏ £¬ÄúÐèÒªÐÞ¸ÄÖ÷ÉèÖÃÎļþconfig.php £¬ÔöÌíÒÔÏÂÄÚÈÝ£º

'url_common_param'       =&gt; true,
'url_route_on'           =&gt; true,
'url_route_must'         =&gt; false,
'url_html_suffix'        =&gt; '',
'app_debug'              =&gt; true,
'unix_socket'            =&gt; '/var/run/mysqld/mysqld.sock',
'app_path'               =&gt; realpath(__DIR__.'/../application') . '/',

µÇ¼ºó¸´ÖÆ

ÔÚÕâÀï £¬ÎÒÃǽ«app_pathÉèÖÃΪthinkphpÎļþ¼ÐËùÔڵķ¾¶ £¬Õâ¸æËß¿ò¼ÜÒªÔÚÄÇÀï²éÕÒÓ¦ÓóÌÐòµÄ´úÂëÎļþ¡£Çë×¢ÖØ £¬ÔÚPHPÖÐ £¬½«__DIR__£¨Ë«Ï»®Ïߣ©ÓÃÓÚ»ñÈ¡Ä¿½ñÎļþµÄĿ¼ £¬¶ø²»ÊÇÓÃÓÚ»ñÈ¡Ä¿½ñÊÂÇéĿ¼¡£Òò´Ë £¬realpath(__DIR__.’/../application’)±í´ïµÄÊÇthinkphpÉϼ¶Ä¿Â¼ÏµÄapplicationĿ¼·¾¶¡£

ËÄ¡¢×ܽá

ÎÞÂÛÊÇÔÚÍâµØÇéÐΡ¢ÐéÄâÖ÷»úÕÕ¾ÉÔ¶³ÌЧÀÍÆ÷ÉÏ £¬ÎÒÃǶ¼ÐèҪ׼ȷµØ°²ÅÅthinkphpÎļþ¼Ð £¬²¢ÉèÖúÃËüµÄ·¾¶ÐÅÏ¢À´È·±£¿ò¼ÜµÄÕý³£ÔËÐС£ÔÚ±¾ÎÄÖÐ £¬ÎÒÃÇÌṩÁËһЩ½ÏÁ¿Í¨ÓõÄ×ö·¨ £¬µ«Æ¾Ö¤ÏÖÕæÏàÐÎ £¬Äú¿ÉÄÜÐèÒª¶ÔËüÃǾÙÐÐһЩ΢µ÷¡£ÎÞÂÛÔõÑù £¬Çë¼Ç×Å £¬×¼È·°²ÅÅthinkphpÊÇÒ»¸ö¿ª·¢Àú³ÌÖÐÊ®·ÖÖ÷ÒªµÄ°ì·¨ £¬Ëü½«È·±£Äú¿ª·¢µÄÓ¦ÓóÌÐòÄܹ»Õý³£ÔËÐС£

ÒÔÉϾÍÊDzî±ðÇéÐÎÏÂthinkphpÓ¦¸Ã·ÅÔÚÄÇÀïµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±

18523999891

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

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

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