在 FreeBSD 11.2 里安装使用 nginx + php7.1(php-fpm) + mysql 5.7

开发者论坛 > 云分享> 帖子正文


在 FreeBSD 11.2 里安装使用 nginx + php7.1(php-fpm) + mysql 5.7

dongshan8 02-11 回复 0 浏览 1382
过程: 1.pkg install nginx # 安装 nginx-1.14 2.pkg install mysql57-server # 安装 mysql server 5.7 3.pkg install php71 php71-curl  php71-gd  php71-mbstring php71-mcrypt php71-mysqli php71-openssl php71-pdo_mysql php71-xml # 安装 php7.1 和相关模块 4.vi /usr/local/etc/nginx/nginx.conf # 编辑nginx配置文件,添加站点,如本例添加drs2.anqun.org的https站点 [code]server {         listen       443 ssl;         server_name  drs2.anqun.org;         ssl_certificate      ssl/drs2.anqun.org.pem;         ssl_certificate_key  ssl/drs2.anqun.org.key;         ssl_session_cache    shared:SSL:1m;         ssl_session_timeout  5m;         ssl_ciphers  HIGH:!aNULL:!MD5;          ssl_prefer_server_ciphers  on;          location / {                  root   /usr/local/www/nginx/drs2.anqun.org;                  index  index.html index.htm index.php;                  try_files $uri $uri/ /index.php?$args;                 }         # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000         #         location ~ \.php$ {             root           drs2.anqun.org;             fastcgi_pass   127.0.0.1:9000;             fastcgi_index  index.php;             fastcgi_param  SCRIPT_FILENAME  /usr/local/www/nginx/drs2.anqun.org/$fastcgi_script_name;             include        fastcgi_params;         }         }[/code] [attachment=147591] 5.sysrc nginx_enable=yes # 允许 nginx 服务 6.sysrc mysql_enable=yes # 允许 mysql 服务    7.sysrc php_fpm_enable=yes # 允许 php-fpm 服务    8.service nginx start # 启动 nginx 服务    9.service mysql-server start # 启动 nginx 服务    10.service php-fpm start # 启动 nginx 服务    11.ALTER USER 'root'@'localhost'  IDENTIFIED BY 'niDEpASSWORD' ; # 首次启动mysql5.7后,root的密码会写在/root/.mysql_secret 文件里,需要用 ALTER USER 命令更改密码后使用 [attachment=147592]    12.phpinfo显示信息 [attachment=147593]    13.wordpress安装效果 [attachment=147594] 参考:[url]https://www.cnblogs.com/hahawgp/p/3824134.html[/url]
展开全部内容
<上一篇 下一篇>
还没有回复,快来抢沙发吧

相关帖子