博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ubuntu Nginx php 安装与环境配置
阅读量:6958 次
发布时间:2019-06-27

本文共 1304 字,大约阅读时间需要 4 分钟。

  • 安装
sudo apt-get install nginx复制代码
  • 添加php源
sudo add-apt-repository ppa:ondrej/phpsudo apt-get updatesudo apt-get upgrade复制代码
  • 安装php
sudo apt-get install php7.0-fpm php7.0-mysql php7.0-common php7.0-curl php7.0-cli php7.0-mcrypt php7.0-mbstring php7.0-dom复制代码
  • 启动php
sudo service php7.0-fpm startsudo service php7.0-fpm status复制代码
  • 配置 nginx 服务器
cd /etc/nginx/site-avaliabelsudo vim default-- 配置 www 目录root /mnt/c/www;-- 新加 index.php# Add index.php to the list if you are using PHPindex index.html index.htm index.nginx-debian.html index.php;-- 打开注释-- location ~ \.php$-- include snippets/fastcgi-php.conf;-- fastcgi_pass unix:/var/run/php/php7.0-fpm.sock; location ~ \.php$-- (要和 /etc/php/7.0/fpm/pool.d 中的 www.conf 中的 listen = /run/php/php7.0-fpm.sock 一致) # pass PHP scripts to FastCGI server        #        location ~ \.php$ {                include snippets/fastcgi-php.conf;        #        #       # With php-fpm (or other unix sockets):                fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;        #       # With php-cgi (or other tcp sockets):        #       fastcgi_pass 127.0.0.1:9000;        }复制代码
  • 修改配置文件后,需要重新编译配置文件,检查是否配置成功,然后启动 nginx
sudo nginx -tsudo service nginx restart复制代码
  • 安装 mysql-server
sudo apt-get install mysql-server-5.7复制代码

转载于:https://juejin.im/post/5c99f8eb5188252d9a2f6002

你可能感兴趣的文章
Android TextView 横向滚动(跑马灯效果)
查看>>
executor.Executor: Managed memory leak detected; size = 37247642 bytes, TID = 5
查看>>
Linux系统下如何查看及修改文件读写权限
查看>>
win8: IndexedDB
查看>>
移植到Windows CE 的经验
查看>>
android开发学习之ViewPager滑动事件讲解
查看>>
BIEEE 创建多维钻取分析(4)
查看>>
AngularJs表单验证
查看>>
微信分享自定义图片和摘要
查看>>
visio ppt axure AI svg powerdesign xmind
查看>>
【模式匹配】Aho-Corasick自动机
查看>>
ExtJs尝下鲜
查看>>
Nginx配置性能优化
查看>>
Atitit.判断元素是否显示隐藏在父元素 overflow
查看>>
SharePoint 2013 激活标题字段外的Menu菜单
查看>>
Java的异步HttpClient
查看>>
关于android中调用系统拍照,返回图片是旋转90度
查看>>
jQuery页面加载初始化的3种方法
查看>>
python常见环境安装
查看>>
生成随机唯一号码, 比如订单号
查看>>