• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Debian8部署laravel5.3(php7.0+nginx)

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

web根目录:/var/www/html

更换 apt-get 源
cd /etc/apt/sources.list
deb http://ftp.debian.org/debian jessie main contrib non-free
deb http://ftp.debian.org/debian jessie-updates main contrib non-free
deb http://security.debian.org jessie/updates main contrib non-free
deb http://packages.dotdeb.org jessie all
deb http://ftp.debian.org/debian jessie-backports main

更新 apt-get 源
apt-get update

安装composer
apt-get install composer

新建laravel项目
cd /var/www/html
composer create-project laravel/laravel app --prefer-dist
chmod -R 755 app
cd app
chmod -R 777 bootstrap
chmod -R 777 storage

安装php7.0
apt-get php php-fpm

安装nginx
apt-get nginx

编辑php.ini
vim /etc/php/7.0/fpm/php.ini
;cgi.fix_pathinfo=1修改为cgi.fix_pathinfo=0

编辑nginx配置
vim /etc/nginx/sites-enabled/default

server {
    listen 80;
 
    server_name app.com; #你的域名
    root /var/www/html/app/public;
    index index.php;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }
 
    location ~ \.php$ {
        try_files $uri /index.php =404;
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
        fastcgi_index index.php;
          fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        include fastcgi_params;
    }


    location ~ /\.ht {
        deny all;
    }

}



嘿嘿,mysql自行安装,以及php相关扩展


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP执行效率检查-xdebug使用发布时间:2022-07-10
下一篇:
PHP的SQL注入攻击的技术实现以及预防措施 - 飞雪天下发布时间:2022-07-10
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap