mysql管理 php脚本_Just for fun——windows上bat管理你的Nginx+PHP+MySQL

文件目录结构

daa2cc86966e0d22f19a94de9b71d997.png

start_nginx.bat为开启nginx的脚本

start_php_fpm.bat为开启php-fpm的脚本

start_mysql.bat为开启mysql服务的脚本

start.bat为开启上述所有进程的脚本

stop.bat为关闭所有进程的脚本

如果你更喜欢GUI程序,可以使用SalamanderWnmp

简单使用手册

***********Author Salamander**************

1. 把nginx,mysql,php压缩包解压,并命名为nginx,mysql,php7(标识一下新版本而已),以下配置文件用utf-8修改(sublime即可)

2. php目录中把php.ini-development(或者php.ini-production)改为php.ini,修改extension_dir配置,注意去掉分号(;)

分号表示注释,另外把一些扩展也加载进来(去掉前面分号即可)

**********************************************

extension=php_bz2.dll

extension=php_curl.dll

extension=php_fileinfo.dll

extension=php_ftp.dll

extension=php_gd2.dll

extension=php_gettext.dll

; Directory in which the loadable extensions (modules) reside.

; http://php.net/extension-dir

; extension_dir = "./"

; On windows:

extension_dir = "D:/nmp/php7/ext"

**********************************************

启动php-cgi可以双击start_php_fpm.bat即可

3.进入nginx中conf目录,打开nginx.conf文件

找到server段(配置localhost虚拟主机)

*************************************************************

server {

listen 80;

server_name localhost;

root D:/web_root;

index index.php index.html index.htm;

#charset koi8-r;

#access_log logs/host.access.log main;

#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;

}

# pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000

#

location ~ \.php$ {

fastcgi_pass 127.0.0.1:9000;

fastcgi_index index.php;

fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

include fastcgi_params;

}

}

*************************************************************

这个server的根目录为D盘下web_root,index第一个为index.php

你需要D盘新建web_root文件夹,再在web_root中新建文件index.php,写入

echo "hello salamander"; // 为了测试下nginx和php

启动nginx可以双击start_nginx.bat即可

4.mysql目录中放入my.ini文件,内容为

*****************************************************************

[client]

port=3306

default-character-set=utf8

[mysqld]

port=3306

innodb_buffer_pool_size = 512M

character_set_server=utf8

server_id=784

basedir=D:/nmp/mysql

#解压目录

datadir=D:/nmp/mysql/data

#解压目录下data目录

max_allowed_packet = 10M

table_open_cache = 256

sort_buffer_size = 1M

read_buffer_size = 1M

read_rnd_buffer_size = 4M

myisam_sort_buffer_size = 64M

thread_cache_size = 8

log-bin=mysql-bin

sql_mode=NO_ENGINE_SUBSTITUTION,STRICT_TRANS_TABLES

*****************************************************************

启动mysql可以双击start_mysql.bat即可

5. 关闭所有进程,双击stop.bat即可,启动所有进程,双击start.bat

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值