Files
docs/Windows/Windows教程.md
2026-01-14 11:27:47 +08:00

53 lines
2.0 KiB
Markdown

# 设置虚拟化程序可用内存
[wsl2]
memory=2GB
swap=2GB
localhostForwarding=true
ver ::显示windows版本
set ::显示,设置,删除环境变量
gpresult /z /scope user ::显示用户组策略详细信息
driverquery ::显示设备驱动状态和属性
diskpart ::显示磁盘分区属性
rem format 格式化磁盘
#安装telnet客户端功能
dism -online -enable-feature -featurename:TelnetClient
#卸载telne客户端功能
dism -online -disable-feature -featurename:TelnetClient
#telnet服务端同上
dism -online -enable-feature -featurename:TelnetServer
dism -online -disable-feature -featurename:TelnetServer
#启动telnet服务
sc config tlntsvr start= auto&net start telnet
#禁用telnet服务
sc config tlntsvr start= disabled&net stop telnet
# 配置WAPM网站环境
在php中文网下载apache的windows版与php7和mysql5.7
将所有压缩包解压到同一个目录下D:/web
三个目录分别是apache24,php7,mysql
1.配置Apache服务
在apache24/conf目录内找到httpd.conf文件
在第38行找到修改为 Define ServerRoot "D:/web/apache24"
在第245行找到 DOcumentRoot "D:/WWW" //网站根目录位置
在280行找到 DirectoryIndex index.html 在后面添加index.php //添加默认页面
在命令行进入d: cd web/apache24/bin 输入httpd回车
在D:/web/apache24/bin目录下执行httpd.exe -k install -n "apache" //将apache添加为本地服务
在命令行使用net start apache 启动apache服务
2.配置PHP服务
进入php7目录找到php.ini-development 复制后重名为php.ini
进入Apache/conf目录找到httpd.conf文件,在末尾添加
#php72 support
LoadModule php7_module "D:/web/php7/php7apache2_4.dll"
AddHandler application/x-httpd-php .php
#configure the path to php.ini
PHPIniDir "D:/web/php7"
重启apache服务
3.配置mysql服务
打开之前复制的php.ini文件
在732行找到;extension_dir = "ext" 替换为extension_dir = "D:/web/php7/ext"并去掉前面的分号";"
在897行找到;extension=mysqli 去掉前面的分号,根据需要开启下面几行的pdo支持