1.打开 C:\Windows\System32\drivers\etc

把 hosts 文件移到桌面. 把只读去掉.更改里面的配置

127.0.0.1 localhost
127.0.0.1 baidu.hd
127.0.0.1 qq.hd

更改之后移回原来位置

前面是本机服务器的IP 后面是自己设定的域名.有多少可以增加多少条.

2.打开 D:\wamp\bin\apache\Apache2.2.21\conf (根据自己机器的WAMP目录找)

打开httpd.conf 搜索 vhost

Include conf/extra/httpd-vhosts.conf 把前面的 # (注释) 去掉. 这样就可以 引用这个路径的配置文件

3.打开 D:\wamp\bin\apache\Apache2.2.21\conf\extra

打开 httpd-vhosts.conf 文件. 把下面的代码复制. 一个域名分配一套

<VirtualHost *:80> 
    ServerAdmin  webmaster@dummy-host2.example.com 
    DocumentRoot D:/wamp/www/qq 
    ServerName qq.hd 
    ErrorLog "logs/dummy-host2.example.com-error.log" 
    CustomLog "logs/dummy-host2.example.com-access.log" common 
</VirtualHost>

最后重新启动WAMP即可通过浏览器直接输入 qq.hd 直接访问了你的项目了..如果 127.0.0.1 或者 localhost无法访问你的www

可以分别多设置一下即可.

如:

<VirtualHost *:80> 
    ServerAdmin  webmaster@dummy-host2.example.com 
    DocumentRoot D:/wamp/www
    ServerName 127.0.0.1
    ErrorLog "logs/dummy-host2.example.com-error.log" 
    CustomLog "logs/dummy-host2.example.com-access.log" common 
</VirtualHost>

完~

记录一个laravel-excel导出表格值为0导出excel显示空的解决方法。

最近在使用laravel-excel导出表格的时候,发现假如字段值为0的情况下,导出的excel中直接显示为空,找到一个方法解决,如下. 在laravel-excel的config配置中...

阅读全文

php实现redis延时队列

写了一个简单的类实现 使用方法 $class = new RedisDelayQueue(); $class->execute(); <?php namespace app\common\service; class RedisDelay { ...

阅读全文

php获取包含10w个手机号的txt文件(逗号隔开)

txt文件格式如下 13000000000,13000000005,13000000403,13001010129,13001010688,13001010838,13001016389,13001019538,13001030005,13001042700,13001047495...

阅读全文

2 条评论

欢迎留言