首页 > 系统服务 > 详细

Ubuntu 16.04.6 LTS 配置Laravel环境

时间:2019-07-09 16:14:06      阅读:128      评论:0      收藏:0      [点我收藏+]

Laravel介绍

Laravel 是一套简洁、优雅的 PHP Web 开发框架,采用了 MVC 的架构模式。它可以让你从杂乱的代码中解脱出来,帮你构建一个完美的网络 APP。

Laravel 的代码简洁、富于表达力,可以说是为 WEB 艺术家创造的 PHP 框架,在 2011 年 6 月正式发布了首个版本。

Laravel 结合了 PHP 强大的扩展包(Composer)系统与 PHP 开发者广大的受众群,具备快速开发的特点,这些优势让 Laravel 在发布之后短短几年就得以飞速发展,成为近两年最火热的PHP框架。

版本

系统版本:Ubuntu 16.04.6 LTS (GNU/Linux 4.4.0-151-generic x86_64)

Laravel版本:5.8

PHP版本:7.2

安装Apache

sudo apt-get update

sudo apt-get install apache2

安装PHP

sudo apt-get install software-properties-common python-software-properties 

sudo add-apt-repository ppa:ondrej/php && sudo apt-get update

sudo apt-get -y install php7.2

sudo apt-get install -y php7.2-fpm php7.2-mysql php7.2-curl php7.2-json php7.2-mbstring php7.2-xml  php7.2-intl

sudo apt-get install openssl

#可选
sudo apt-get install php7.2-gd
sudo apt-get install php7.2-soap
sudo apt-get install php7.2-gmp    
sudo apt-get install php7.2-odbc       
sudo apt-get install php7.2-pspell     
sudo apt-get install php7.2-bcmath   
sudo apt-get install php7.2-enchant    
sudo apt-get install php7.2-imap       
sudo apt-get install php7.2-ldap       
sudo apt-get install php7.2-opcache
sudo apt-get install php7.2-readline   
sudo apt-get install php7.2-sqlite3    
sudo apt-get install php7.2-xmlrpc
sudo apt-get install php7.2-bz2
sudo apt-get install php7.2-interbase
sudo apt-get install php7.2-pgsql      
sudo apt-get install php7.2-recode     
sudo apt-get install php7.2-sybase     
sudo apt-get install php7.2-xsl
sudo apt-get install php7.2-cgi        
sudo apt-get install php7.2-dba 
sudo apt-get install php7.2-phpdbg     
sudo apt-get install php7.2-snmp       
sudo apt-get install php7.2-tidy       
sudo apt-get install php7.2-zip

安装Laravel

curl -sS https://getcomposer.org/installer | php

sudo mv composer.phar /usr/local/bin/composer

composer config -g repo.packagist composer https://packagist.phpcomposer.com

sudo apt-get install git

apt-get install zip

composer create-project laravel/laravel project --prefer-dist “5.8.*”

Apache开启Rewrite

sudo a2enmod rewrite

vim /etc/apache2/apache2.conf
#把AllowOverride None 改为 AllowOverride All
<Directory /var/www/xxx>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
</Directory>

配置网站目录

mkdir xxx

git clone code

composer install

vim /etc/apache2/sites-enabled/000-default.conf #配置站点目录

service apache2 restart

chmod 777 -R storage

ln -s /var/www/html/xxx/storage/app/public/ /var/www/html/xxx/public/storage #配置存储目录软链接

php artisan key:generate

Ubuntu 16.04.6 LTS 配置Laravel环境

原文:https://www.cnblogs.com/screensuper/p/ubuntu-16-04-6-LTS-config-laravel.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!