Laravel 5.5搭建(lunix-ubuntu)
基本配置
PHP >= 7.0.0
PHP OpenSSL 扩展
PHP PDO 扩展
PHP Tokenizer 扩展
PHP XML 扩展
1:nginx
sudo apt-get update
sudo apt-get install nginx
(在ubuntu14上安装 nginx1.10*):
https://blog.csdn.net/leonshi001/article/details/73994408
2:php7.*
sudo add-apt-repository ppa:ondrej/php
sudo apt-get install php7.1 php7.1-cli php7.1-fpm php7.1-gd php7.1-json
安装几个扩充:
sudo apt-get install phpunit
sudo apt-get install php7.1-zip
sudo apt-get install php7.1-mbstring
sudo apt-get install php7.1-xml
3:安装composer
curl -sS https://getcomposer.org/installer | php
/usr/bin/php composer.phar --version
加入全局变量
sudo mv composer.phar /usr/local/bin/composer
查看版本号
sudo composer -v
4:创建laravel工程
1、新建文件夹
sudo mkdir /data
cd /data
2、创建工程
sudo composer create-project --prefer-dist laravel/laravel webLaravel "5.5.*"
cd webLaravel
sudo chmod -R 777 storage
5、配置nginx
cd /etc/nginx/sites-available/
sudo cp default webLaravel.conf
sudo vim webLaravel.conf
添加以下配置
root /data/webLaravel/public; index index.php; server_name exc.tts.com; (你的域名) location ~ \.php$ { include snippets/fastcgi-php.conf; fastcgi_pass unix:/run/php/php7.1-fpm.sock; }
生成软连接
cd /etc/nginx/sites-enabled sudo ln -s /etc/nginx/sites-available/webLaravel.conf webLaravel.conf
重新启动nginx
sudo service nginx restart
浏览器访问 exc.tts.com。 成功!