在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
安装nginx 1.安装brew命令 ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" 2.使用brew 安装nginx brew install nginx
3.修改配置nginx 文件 (文件应该在 /usr/local/etc/nginx/nginx.conf) server { listen 8080; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root /you/web/path; #配置web目录 #root /usr/local/var/www; autoindex on; index index.html index.htm index.php; #添加php默认 } (开启PHP支持)修改为如下 location ~ \.php$ { root /you/web/path; #root /usr/local/var/www; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; #fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } 4.启动nginx sudo nginx
5.有些情况需要打开,php-fpm 否则会报服务器错误~ sudo php-fpm
|
2022-08-30
2022-08-17
2022-11-06
2022-08-17
2022-08-16
请发表评论