php+nginx+mysql环境配置
来源:互联网 发布:软件项目标书 编辑:程序博客网 时间:2024/06/01 07:42
下载 RunHiddenConsole.exe,nginx,php,mysql,composer 中国镜像,
通过composer 生成lavarl项目;
1.php.ini设置
extension=php_openssl.dll
extension=php_mbstring.dll
2.建立 start_nginx_php.bat文件
@echo off
echo Starting PHP FastCGI...
RunHiddenConsole E:/PhpIntegration/php/php-cgi.exe -b 127.0.0.1:9000 -c E:/PhpIntegration/php/php.ini
echo Starting Nginx...
RunHiddenConsole E:/PhpIntegration/nginx-1.10.3/nginx.exe -c E:/PhpIntegration/nginx-1.10.3/conf/nginx.conf
echo Starting MySQL Server...
RunHiddenConsole C:\Program Files\MySQL\MySQL Server 5.7\bin\mysqld.exe
3.建立 stop_nginx_php.bat文件
@echo off
echo Stopping nginx...
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
echo Stopping MySQL Server...
taskkill /F /IM mysqld.exe > nul
exit
echo Stopping nginx...
taskkill /F /IM nginx.exe > nul
echo Stopping PHP FastCGI...
taskkill /F /IM php-cgi.exe > nul
echo Stopping MySQL Server...
taskkill /F /IM mysqld.exe > nul
exit
4.主要 nginx.config
server {
listen 80;
server_name localhost;
client_max_body_size 30m;
#charset koi8-r;
#set $root_path 'E:/study/php/phpStudy/laravel5_backend/public';
#set $root_path 'E:/study/php/phpStudy/laravel55/public';
set $root_path 'E:/study/php/phpStudy/lumen/public';
root $root_path;
#access_log logs/host.access.log main;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location / {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
# root d:/www/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
listen 80;
server_name localhost;
client_max_body_size 30m;
#charset koi8-r;
#set $root_path 'E:/study/php/phpStudy/laravel5_backend/public';
#set $root_path 'E:/study/php/phpStudy/laravel55/public';
set $root_path 'E:/study/php/phpStudy/lumen/public';
root $root_path;
#access_log logs/host.access.log main;
index index.php index.html index.htm;
try_files $uri $uri/ @rewrite;
location @rewrite {
rewrite ^/(.*)$ /index.php?_url=/$1;
}
location / {
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
# proxy the PHP scripts to Apache listening on 127.0.0.1:80
#
#location ~ \.php$ {
# proxy_pass http://127.0.0.1;
#}
# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
#
location ~ \.php$ {
# root d:/www/nginx/html;
fastcgi_pass 127.0.0.1:9000;
fastcgi_index /index.php;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
#fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~* ^/(css|img|js|flv|swf|download)/(.+)$ {
root $root_path;
}
location ~ /\.ht {
deny all;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
#location ~ /\.ht {
# deny all;
#}
}
阅读全文
0 0
- php+nginx+mysql环境配置
- Ubuntu配置Nginx+PHP+MySQL开发环境
- 配置Linux+Nginx+PHP+MySQL运行环境
- Mac 配置PHP、Nginx、Mysql环境
- windows环境配置 nginx + php + mysql
- php+nginx+mysql环境配置windows
- windows下配置php 环境 nginx mysql php
- 搭建LNMP(linux+nginx+mysql+php)服务器环境配置实例教程
- centos 配置nginx php-fpm mysql 环境步骤
- CentOS 6.3+apache+nginx+mysql+php环境配置
- CentOS 6.4 Nginx + PHP-FPM + MySQL 环境配置
- Linux下安装配置nginx+php+mysql环境
- LNMP(linux+nginx+mysql+php)服务器环境配置
- LNMP(linux+nginx+mysql+php)服务器环境配置
- LNMP(linux+nginx+mysql+php)服务器环境配置
- LNMP服务器环境配置 (linux+nginx+mysql+php)
- Mac环境下Nginx+PHP+MySQL的安装与配置
- LNMP(linux+nginx+mysql+php)服务器环境配置
- 多任务学习“Embedding Label Structures for Fine-Grained Feature Representation”
- 第二步:蓝牙初了解
- Linux三剑客命令常见用法之grep
- 离线安装cloudera Manager
- 糗事百科案例(使用 xpath模块)
- php+nginx+mysql环境配置
- 阻止事件冒泡,阻止默认事件,阻止所有事件的方法
- 学习 谭浩强c语言设计 & 慕课 笔记(2017.10.24)
- 抽象工厂模式
- 动态手势识别实战
- ViewPager无限轮播
- 进程间通讯——信号量
- angular搜索 过滤 批量删除 添加 表单验证等小集成
- linux安装GCC