xampp配置

发布时间 2023-10-10 14:39:56作者: songxia777

XAMPP不同版本下载

https://sourceforge.net/projects/xampp/files/XAMPP Windows/

1. 配置hosts路由

打开文件:C:\Windows\System32\drivers\etc\hosts

# company project
127.0.0.1 localhost
127.0.0.1 www.hcyuan.com

2. xampp文件配置

配置文件:D:\xampp\apache\conf\httpd.conf

<Directory "E:/hongchanyuan">
    Options Indexes FollowSymLinks Includes ExecCGI
    AllowOverride All
    Require all granted
</Directory>

配置文件:D:\xampp\apache\conf\extra\httpd-vhosts.conf

# 此配置项中的第一个项目 可以使用ip地址访问
# 项目网站 默认端口
<VirtualHost *:80>
 DocumentRoot "E:/hongchanyuan"
 ServerName www.hcyuan.com
 ErrorLog "logs/dummy-host2.example.com-error.log"
 CustomLog "logs/dummy-host2.example.com-access.log" common

 RewriteEngine on
 RewriteRule ^/mobile/(index|404)\.html$ /class/app/mrouter.php
 RewriteRule ^/(index|404)\.html$ /class/app/router.php
 # PC 目录
 RewriteRule ^/(ad|find|game|mncg|clause|hctj|live|message|pay|shop|user|AIJlb|hyb|soft|about|h5live|h5wap|fc|feedback|guide|cyyd|jczhishi) /class/app/router.php

 # WAP 目录
 RewriteRule ^/mobile/(ad|find|game|mncg|clause|hctj|live|message|pay|shop|user|AIJlb|hyb|soft|about|h5live|h5wap|fc|feedback|guide|cyyd|jczhishi) /class/app/mrouter.php
 RewriteRule ^/mobile* /class/app/mrouter.php
</VirtualHost>

3. redis扩展插件安装

https://blog.csdn.net/weixin_44382179/article/details/119808705

将对应的文件下载以后(注意:一定要下载对应的版本号),放到文件 D:\xampp\php\ext\ 中
一共4个文件:

php_redis.dll
php_redis.pdb
php_igbinary.dll
php_igbinary.pdb

查看php版本

创建一个php文件,并运行查看 phpinfo.php

<?php
phpinfo();