尊龙凯时人生就是搏

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
sitemap¡¢ÍøÕ¾µØͼ