×ðÁú¿­Ê±

thinkphpÔõÑù×°ÖÃ

Ò»¡¢ÏÂÔØ ThinkPHP Ô´Âë

ÎÒÃÇÐèÒªÏÈÏÂÔØ×îаæµÄ ThinkPHP Ô´´úÂ룬¿ÉÒÔ´Ó¹Ù·½ÍøÕ¾»ñÈ¡¡£Äú¿ÉÒÔÔÚÏÂÔØÒ³ÃæÉÏÑ¡ÔñѹËõ°ü»òGit´úÂë¿âÀ´¾ÙÐÐÏÂÔØ¡£ÈôÊÇÄúÒѾ­ÊìϤ Git µÄʹÓÃÒªÁ죬¿ÉÒÔÖ±½ÓʹÓà Git ÏÂÁîÀ´¿Ë¡´úÂë¿â£»ÈôÊÇÄú²»ÊìϤ Git£¬Ôò¿ÉÒÔÏÂÔØѹËõ°ü¾ÙÐÐ×°Öá£

¶þ¡¢½âѹԴÂë

ÏÂÔØÍê³Éºó£¬½«Ñ¹Ëõ°ü½âѹµ½ÄúµÄ Web ЧÀÍÆ÷µÄÖ¸¶¨Ä¿Â¼Ï¡£Õâ¸öĿ¼ͨ³£ÊÇÄúµÄ Web ЧÀÍÆ÷Ëù¼àÌýµÄĿ¼¡£¾Ù¸öÀý×Ó£¬ÈôÄúÕýÔÚÔËÐÐ Apache ЧÀÍÆ÷£¬¸ÃĿ¼һÑùƽ³£Îª /var/www/html¡£

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

Èý¡¢ÉèÖà Web ЧÀÍÆ÷

ÔÚÍê³ÉÔ´Âë½âѹºó£¬ÎÒÃÇÐèÒªÉèÖà Web ЧÀÍÆ÷µÄÉèÖÃÎļþ£¬ÒÔ±ãÈÃЧÀÍÆ÷¿ÉÒÔ׼ȷµÄÔËÐÐ ThinkPHP ¿ò¼Ü¡£Æ¾Ö¤ÏÂÃæµÄ°ì·¨¾ÙÐÐÉèÖãº

¹ØÓÚ Apache ЧÀÍÆ÷£¬·­¿ª Apache µÄÉèÖÃÎļþ£¨Í¨³£Îª /etc/httpd/conf/httpd.conf£©£¬Ìí¼ÓÏÂÃæµÄ´úÂ룺

<VirtualHost *:80>
    ServerName your.server.name
    DocumentRoot /path/to/thinkphp/public
    <Directory /path/to/thinkphp/public>
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

µÇ¼ºó¸´ÖÆ

ÆäÖУ¬your.server.name ÊÇÄúµÄЧÀÍÆ÷ËùʹÓõÄÓòÃû»ò IP µØµã£¬/path/to/thinkphp ÊÇÄúµÄ ThinkPHP Ô´ÂëËùÔÚµÄĿ¼¡£Õâ¸öÉèÖÃÎļþ»áÈÃÄúµÄЧÀÍÆ÷¼àÌý 80 ¶Ë¿Ú£¬²¢½«ËùÓÐÀ´×Ô your.server.name µÄÇëÇóÖض¨Ïòµ½ ThinkPHP ³ÌÐòµÄÈë¿ÚÎļþ£¨Í¨³£ÊÇ index.php£©¡£

¹ØÓÚ Nginx ЧÀÍÆ÷£¬·­¿ª Nginx µÄÉèÖÃÎļþ£¨Í¨³£Îª /etc/nginx/nginx.conf£©£¬Ìí¼ÓÏÂÃæµÄ´úÂ룺

server {
    listen 80;
    server_name your.server.name;
    location / {
        root /path/to/thinkphp/public;
        index index.php;
        try_files $uri $uri/ /index.php?$args;
    }
    location ~ \.php$ {
        root /path/to/thinkphp/public;
        fastcgi_pass unix:/run/php-fpm/www.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }
}

µÇ¼ºó¸´ÖÆ

ÆäÖУ¬your.server.name ÊÇÄúµÄЧÀÍÆ÷ËùʹÓõÄÓòÃû»ò IP µØµã£¬/path/to/thinkphp ÊÇÄúµÄ ThinkPHP Ô´ÂëËùÔÚµÄĿ¼¡£Õâ¸öÉèÖÃÎļþ»áÈà Nginx ¼àÌý 80 ¶Ë¿Ú£¬²¢½«ËùÓÐÀ´×Ô your.server.name µÄÇëÇóÖض¨Ïòµ½ ThinkPHP ³ÌÐòµÄÈë¿ÚÎļþ£¨Í¨³£ÊÇ index.php£©¡£

ËÄ¡¢×°ÖÃÊý¾Ý¿â¼°ÉèÖÃÓ¦ÓÃÉèÖÃ

ÔÚÉèÖÃÍê Web ЧÀÍÆ÷Ö®ºó£¬ÎÒÃÇÐèҪΪӦÓóÌÐòÉèÖÃÊý¾Ý¿âÉèÖúÍÓ¦ÓÃÉèÖá£Æ¾Ö¤ÏÂÃæµÄ°ì·¨¾ÙÐвÙ×÷£º

·­¿ª config/database.php Îļþ£¬ÉèÖÃÊý¾Ý¿âÐÅÏ¢¡£ÀýÈ磺

<?php
    return [
        'hostname' => 'localhost',
        'database' => 'thinkphp',
        'username' => 'root',
        'password' => '',
        // ...
    ];

µÇ¼ºó¸´ÖÆ

·­¿ª config/app.php Îļþ£¬ÉèÖÃÓ¦ÓÃÉèÖÃÐÅÏ¢¡£ÀýÈ磺

<?php
    return [
        // Ó¦ÓÃÃû³Æ
        'app_name' => 'ThinkPHP',
        // ĬÈÏʱÇø
        'default_timezone' => 'Asia/Shanghai',
        // µ÷ÊÔģʽ
        'debug' => true,
        // ...
    ];

µÇ¼ºó¸´ÖÆ

Îå¡¢ÔËÐÐ ThinkPHP Ó¦ÓóÌÐò

ÎÒÃÇÒѾ­ÀֳɵØ×°ÖÃÁË ThinkPHP ¿ò¼ÜµÄÔ´´úÂ룬²¢ÀÖ³ÉÉèÖÃÁË Web ЧÀÍÆ÷ºÍÓ¦ÓóÌÐò¡£ÏÖÔÚ£¬ÎÒÃÇ¿ÉÒÔÆô¶¯ Web ЧÀÍÆ÷£¬»á¼ûÄúÉèÖõÄÓòÃû»ò IP µØµã£¬Ó¦¸Ã¾ÍÄÜ¿´µ½Ò»¸ö½Ó´ýÒ³ÃæÌåÏÖÒѾ­ÀֳɵØ×°ÖÃÁË ThinkPHP Ó¦ÓóÌÐò¡£

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

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

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