Php 如何使用同一网络中连接的另一个系统的数据库
我和我的朋友正在为一个wordpress项目工作,我想用他的机器来修改代码甚至数据库 为此,我更改了主机文件和httpd-vhost.conf文件,如下所示 *httpd-vhost.conf文件 *apache中的主机文件Php 如何使用同一网络中连接的另一个系统的数据库,php,mysql,apache,xampp,vhosts,Php,Mysql,Apache,Xampp,Vhosts,我和我的朋友正在为一个wordpress项目工作,我想用他的机器来修改代码甚至数据库 为此,我更改了主机文件和httpd-vhost.conf文件,如下所示 *httpd-vhost.conf文件 *apache中的主机文件 DocumentRoot“\\Anjana pc\c\xampp\htdocs\wordpress” ServerName 192.168.1.99.localhost ServerAlias 192.168.1.99.localhost ServerName wordp
DocumentRoot“\\Anjana pc\c\xampp\htdocs\wordpress”
ServerName 192.168.1.99.localhost
ServerAlias 192.168.1.99.localhost
ServerName wordpress.dev
但它不起作用
我想要的是:每当我在浏览器中输入“wordpress.dev”时,我都想访问项目的所有前端和后端(我们在局域网中连接机器)
我的IP是192.168.1.10,我朋友的PC IP地址是192.168.1.99
提前感谢将ServerAlias从192.168.1.99.localhost更改为ServerAlias wordpress.dev。将第192.168.1.99行wordpress.dev放到/etc/hosts文件中
127.0.0.1 wordpress.dev
<VirtualHost *:80>
DocumentRoot "\\Anjana-pc\c\xampp\htdocs\wordpress"
ServerName 192.168.1.99.localhost
ServerAlias 192.168.1.99.localhost
ServerName wordpress.dev
<Directory "\\Anjana-pc\c\xampp\htdocs\wordpress">
</Directory>
</VirtualHost>