×ðÁú¿­Ê±¹ÙÍøµÇ¼

laravel Ôõô°²ÅÅ

laravelÊÇÒ»¸öÊ¢ÐеÄphp¿ò¼Ü £¬Ê¹ÓÃËü¿ª·¢µÄÓ¦ÓóÌÐò±»ÆÕ±éÓÃÓÚweb¿ª·¢ £¬¿ÉÊÇÐí¶àÈ˶¼²»ÖªµÀÔõÑù½«ËüÃÇ°²Åŵ½Ð§ÀÍÆ÷ÉÏ¡£ÔÚ±¾ÎÄÖÐ £¬ÎÒÃǽ«Ñ§Ï°ÔõÑùʹÓüòÆӵİ취À´°²ÅÅlaravelÓ¦ÓóÌÐò¡£

×¼±¸ÊÂÇé

ÔÚ×îÏÈ֮ǰ £¬È·±£ÄãÒѾ­×°ÖÃÁËLAMP»òLEMP¿ÍÕ»£¨Linux £¬Apache»òNginx £¬MySQLºÍPHP£©¡£ÁíÍâ £¬ÄãÐèҪװÖÃcomposer £¬ËüÊÇphpµÄ°ü¹ÜÀíÆ÷¡£

°ì·¨1£º»ñÈ¡laravelÓ¦ÓóÌÐò

Ê×ÏÈ £¬ÎÒÃÇÐèÒª»ñÈ¡laravelÓ¦ÓóÌÐòµÄÔ´´úÂë¡£LaravelÌṩÁËÁ½ÖÖÒªÁ죺ʹÓÃgit cloneÏÂÁî´ÓGitHubÉÏ¿Ë¡ԴÂë¿â»òÕßʹÓÃcomposer create-projectÏÂÁî´Ópackagist.orgÉÏÏÂÔØȫеÄlaravelÓ¦ÓóÌÐò¡£

ʹÓÃgit cloneÏÂÁî¿Ë¡Դ´úÂë¿â£º

$ git clone https://github.com/laravel/laravel.git

ʹÓÃcomposer create-projectÏÂÁîÏÂÔØȫеÄlaravelÓ¦ÓóÌÐò£º

$ composer create-project –prefer-dist laravel/laravel blog

°ì·¨2£ºÉèÖÃÓ¦ÓóÌÐò

½ÓÏÂÀ´ £¬ÎÒÃÇÐèÒªÉèÖÃlaravelÓ¦ÓóÌÐò¡£·­¿ªÏÂÁîÐÐ £¬½øÈëµ½Ó¦ÓóÌÐòµÄĿ¼ £¬È»ºóÊäÈëÒÔÏÂÏÂÁ

$ cp .env.example .env

$ php artisan key:generate

ÉÏÃæµÄÏÂÁ¸´ÖÆ.env.exampleÎļþ²¢½«ÆäÖØÃüÃûΪ.env £¬È»ºóÌìÉúÒ»¸öеÄÃÜÔ¿¡£ÏÖÔÚÎÒÃÇÐèÒª±à¼­.envÎļþ²¢ÉèÖÃÊý¾Ý¿âµÄÏà¹ØÐÅÏ¢¡£

°ì·¨3£ºÉèÖÃApache»òNginx

ÔÚ±¾°ì·¨ÖÐ £¬ÎÒÃǽ«ÉèÖÃWebЧÀÍÆ÷ÒÔ±ã׼ȷµØÆÊÎöÎÒÃǵÄLaravelÓ¦ÓóÌÐò¡£ÎÒÃÇÒÔNginxΪÀý £¬ÔÚ/etc/nginx/sites-available/Ŀ¼Ï½¨ÉèÒ»¸öеÄÎļþ£º

$ sudo vi /etc/nginx/sites-available/myapp

ÔÚÎļþÖÐÊäÈëÒÔÏÂÄÚÈÝ£º

server {

 listen 80;
 server_name example.com;
 root /var/www/html/myapp/public;

 index index.php index.html index.htm;
 location / {
         try_files $uri $uri/ /index.php?$query_string;
 }

 location ~ .php$ {
         fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
         fastcgi_split_path_info ^(.+.php)(/.+)$;
         fastcgi_index index.php;
         include fastcgi_params;
         fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
         fastcgi_param PATH_INFO $fastcgi_path_info;
 }

µÇ¼ºó¸´ÖÆ

}

ÉÏÊöÉèÖÃʹÓÃNginx×÷ΪWebЧÀÍÆ÷ £¬ÔÚĬÈÏÇéÐÎϼàÌý80¶Ë¿Ú £¬²¢½«Ó¦ÓóÌÐòµÄpublicĿ¼×÷Ϊ¸ùĿ¼¡£×îºó £¬ÖØÆôNginxÒÔʹ¸ü¸ÄÉúЧ£º

$ sudo systemctl restart nginx

°ì·¨4£ºÐû²¼Ó¦ÓóÌÐò

ÏÖÔÚ £¬ÎÒÃÇ¿ÉÒÔͨ¹ýһЩ¼òÆӵİ취À´Ðû²¼LaravelÓ¦ÓóÌÐò¡£½øÈëÓ¦ÓóÌÐòµÄ¸ùĿ¼²¢ÔËÐÐÒÔÏÂÏÂÁ

$ composer install –optimize-autoloader –no-dev

$ php artisan config:cache

$ php artisan route:cache

$ php artisan view:cache

ÉÏÃæµÄÏÂÁÓÅ»¯×Ô¶¯¼ÓÔØÆ÷ £¬ÆÊÎöÓ¦ÓóÌÐòµÄÉèÖà £¬Â·ÓɺÍÊÓͼ £¬²¢½«ËüÃÇÏÖʵ»º´æ¡£Õ⽫¼ÓËÙÓ¦ÓóÌÐòµÄ¼ÓÔØËÙÂÊ¡£

°ì·¨5£ºÉèÖÃÎļþºÍĿ¼ȨÏÞ

ΪÁËÈ·±£LaravelÓ¦ÓóÌÐòÕý³£ÔËÐÐ £¬²¢ÔÚÄã¶ÔÆäµÄÈκθü¸ÄʱÔÊÐíÎļþдÈë £¬ÄãÐèÒªÉèÖÃĿ¼ºÍÎļþµÄȨÏÞ¡£½øÈëÓ¦ÓóÌÐòµÄ¸ùĿ¼²¢ÊäÈëÒÔÏÂÏÂÁ

$ chown -R www-data:www-data /var/www/html/myapp

$ chmod -R 755 /var/www/html/myapp/storage

$ chmod -R 755 /var/www/html/myapp/bootstrap/cache

ÉÏÃæµÄÏÂÁÎļþºÍĿ¼µÄËùÓÐȨºÍ»á¼ûȨÏÞÉèÖÃΪNginxÓû§ºÍ×é¡£

°ì·¨6£º²âÊÔÓ¦ÓóÌÐò

ÏÖÔÚÎÒÃÇ¿ÉÒÔ²âÊÔlaravelÓ¦ÓóÌÐòÊÇ·ñÒѾ­Àֳɰ²ÅÅ¡£·­¿ªWebä¯ÀÀÆ÷²¢ÊäÈëЧÀÍÆ÷µÄIPµØµã»òÓòÃû £¬ÄãÓ¦¸ÃÄܹ»¿´µ½ÄãµÄÓ¦ÓóÌÐòÖ÷Ò³¡£

½áÂÛ

ÔÚ±¾ÎÄÖÐ £¬ÎÒÃÇ̽ÌÖÁËÔõÑù½«LaravelÓ¦ÓóÌÐò°²Åŵ½WebЧÀÍÆ÷¡£ÎÒÃÇͨ¹ý¼òÆӵİ취Íê³ÉÁËÕâ¸öÀú³Ì £¬²¢Ú¹ÊÍÁËÿ¸ö°ì·¨µÄÓÃ;¡£°²ÅÅLaravelÓ¦ÓóÌÐò¿ÉÄÜ»áÓÐһЩÌôÕ½ £¬ÓÈÆäÊǹØÓÚÄÇЩ²»ÊìϤphp¿ò¼ÜºÍWebЧÀÍÆ÷ÖÎÀíµÄÈËÀ´Ëµ¡£Òò´Ë £¬ÎªÁËʹӦÓóÌÐòÕý³£ÔËÐÐ £¬½¨Ò齫ËùÓа취¶¼×ÐϸִÐÐ £¬È·±£LaravelÓ¦ÓóÌÐòÔÚ°²ÅźóÓëÔ¤ÆÚÒ»Ö¡£

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

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

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

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

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

QR code
ÍøÕ¾µØͼ