Ubuntu安裝php7.1版本 laravel環境
Ubuntu安裝php7.1版本 laravel環境
安裝PHP環境
sudo apt-get update
sudo apt-get install -y language-pack-en-base
locale-gen en_US.UTF-8
sudo apt-get install software-properties-common
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get -y install php7.1
sudo apt-get -y install php7.1-mysql
sudo apt-get install php7.1-fpm
apt-get install php7.1-curl php7.1-xml php7.1-mcrypt php7.1-json php7.1-gd php7.1-mbstring
sudo apt-get -y install nginx
sudo apt-get -y install mysql-server-5.6
配置PHP
sudo vim /etc/php/7.1/fpm/php.ini // 將cgi.fix_pathinfo=1這一行去掉註釋,將1改為0
sudo vim /etc/php/7.1/fpm/pool.d/www.conf
// 配置這個 listen = /var/run/php7.1-fpm.sock
sudo service php7.1-fpm restart
sudo vim /etc/nginx/sites-available/default
配置Nginx
listen 80 default_server;
listen [::]:80 default_server ipv6only=on;
root /var/www/laravel-ubuntu/public;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name localhost;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
try_files $uri $uri/ /index.php?$query_string;
# Uncomment to enable naxsi on this location
# include /etc/nginx/naxsi.rules
}
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php7.1-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
還有就是,注意 laravel-ubuntu 這個目錄的所有者為: www-data:www-data
最後給,storage 資料夾許可權,重啟 Nginx
相關文章
- ubuntu 安裝php7.1UbuntuPHP
- Ubuntu 環境安裝 phpunitUbuntuPHP
- ubuntu下安裝boost環境Ubuntu
- laradocker 安裝 Laravel 環境DockerLaravel
- Windows 環境下安裝 LaravelWindowsLaravel
- ubuntu 16.04安裝LNMP環境UbuntuLNMP
- Ubuntu環境Anaconda安裝opencvUbuntuOpenCV
- ubuntu 安裝 flutter 開發環境UbuntuFlutter開發環境
- Ubuntu20 LNMP 環境安裝UbuntuLNMP
- Ubuntu 安裝php+mysql 環境UbuntuPHPMySql
- ubuntu安裝Java開發環境UbuntuJava開發環境
- ubuntu環境下安裝perf工具Ubuntu
- Laravel + Vue3 環境安裝LaravelVue
- 在Ubuntu環境下安裝eclipseUbuntuEclipse
- Ubuntu 16.04 安裝 Gnome 桌面環境Ubuntu
- Win 10 環境配置VirtualBox安裝UbuntuUbuntu
- Ubuntu16環境安裝和使用NFSUbuntuNFS
- Ubuntu系統-FFmpeg安裝及環境配置Ubuntu
- 用docker安裝laravel的開發環境DockerLaravel開發環境
- Ubuntu 16 下部署 Laravel LNMP 環境UbuntuLaravelLNMP
- 在Ubuntu上安裝Drone持續整合環境Ubuntu
- Ubuntu 16.04 環境安裝部署(更新版)Ubuntu
- 在Ubuntu16.04上安裝LEMP環境Ubuntu
- ubuntu14.04環境安裝docker體驗UbuntuDocker
- Ubuntu下安裝配置java開發環境啊UbuntuJava開發環境
- ubuntu14.04 安裝 Rails 環境, Nginx PassengerUbuntuAINginx
- ubuntu如何完全解除安裝和安裝 Java及android環境?UbuntuJavaAndroid
- 新裝Ubuntu環境配置Ubuntu
- centos7 下安裝laravel 執行環境CentOSLaravel
- 如何在Ubuntu 20.04上安裝Unity桌面環境UbuntuUnity
- 在 Ubuntu18.04 下安裝 LNMP 環境UbuntuLNMP
- Ubuntu下搭建JAVA開發環境及解除安裝UbuntuJava開發環境
- ubuntu 安裝 OpenCv 及其Qt的開發環境配置UbuntuOpenCVQT開發環境
- 多 PHP 版本共存的環境下安裝 Swoole 到指定版本PHP
- Ubuntu安裝golang多版本UbuntuGolang
- docker 安裝 Laravel 環境 (nginx mariadb PHP7.2)DockerLaravelNginxPHP
- docker 安裝 Laravel 環境 (nginx mariadb PHP7.3)DockerLaravelNginxPHP
- Laravel 學習之 Homestead 安裝篇(Windows 環境)LaravelWindows