我也是用apache+mysql+php设的虚拟主机。现在可以编译php文件了。而mysql 的数据库也可以使用了
不知道还有什么地方没有完成的?我这个是算成功了吗?因为我一直没有将php和数据库连接过,所以还有个疑问~???
不知道还有什么地方没有完成的?我这个是算成功了吗?因为我一直没有将php和数据库连接过,所以还有个疑问~???
解决方案 »
- phpMyAdmin-3.4.5-all-languages怎么安装啊
- 小弟实在没有思路如何做
- InternetExplorer.Application': 拒绝访问。
- 二级连动菜单--请各位帮忙注释一下这个谢谢
- 请教哪里有这个的PHP教程
- session和cookie
- 如何在正则表达式的引用后面插入数字?
- mysql这么慢???select * from list ORDER BY id DESC LIMIT 49990,10 竟然需要7秒??!!
- 用PHP怎样来识别输入框的汉字是BIG5码还是GB码?请赐教!
- curl post问题
- 项目外包,内详~~~
- 有没有程序可以让不支持global_register=off的程序支持off呢??
<?php
$mysqlhost="localhost";
$username="root";
$password="123";
$mysqldbname="test";
$conn = @mysql_connect($mysqlhost,$username,$password);
if(!$conn){
echo("没能连通数据库服务器" );
exit();
}
if(!@mysql_select_db($mysqldbname)){
echo( "没能连通数据库");
exit();
}
?>
# BindAddress: You can support virtual hosts with this option. This directive
# is used to tell the server which IP address to listen to. It can either
# contain "*", an IP address, or a fully qualified Internet domain name.
# See also the <VirtualHost> and Listen directives.
#
BindAddress * 这个加了没有。
去掉#了没?
再看看这里的讨论
http://www.douzhe.com/docs/bbsjh/3/13871.html
BindAddress * 这个是在什么地方添加的?我在httpd.conf里面加了以后,起httpd会出错!提示:
Apache 1.3 configuration directives found
please read /usr/share/doc/httpd-2.0.40/migration.html
直接修改system32\drivers\etc\hosts文件(linux系统的话是/etc/hosts),里面加一行映射
192.168.0.9 test.company.com
就行了。
每次测试你都去改真实的dns设置不是要烦死。BindAddress的话你直接在httpd.conf里面搜索,他初始的配置应该就有的。
#
# VirtualHost: If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at
# <URL:http://httpd.apache.org/docs-2.0/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.#
# Use name-based virtual hosting.
#ServerName server.company.com
NameVirtualHost 192.168.0.9#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
#The first VirtualHost section is used for requests without a known
# server name.
#<VirtualHost 192.168.0.9>
ServerAdmin [email protected]
DocumentRoot /home/test
ServerName test.company.com
ErrorLog logs/dummy-host.example.com-error_log
CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
这是我在httpd.conf里面设置的内容,其它的都为默认的配置