Sunday 15 July 2012

php - Connecting to wamp server from different pc -


I created a webpage that uses mysql if I use it with my system (localhost) works fine. I have uploaded my webpage to the server to connect with my friends. Although I can not connect to it. I have gone through other questions posted about the subject here. I tried to improve this problem in which I have collected comments while reading comments. Like-wamp server by putting online, in:

  & lt; Directory c: / wamp / www / & gt; Allow the order, reject Allow all required permissions & lt; / Directory & gt;   

However, I still can not connect to my PC after hosting it on the server. I have used an FTP software to transfer my files to connect to MySQL. My PHP code for:

  mysql_connect ('localhost: 3306', $ user, $ pass) or die ("connection failure". Mysql_error ());    

You must follow these steps:

1 Httpd In the .conf

  DocumentRoot "C: / xampp / htdocs" // Add your wwwroot folder path (this is an Xampp example) & lt; Directory / & gt; Option Follow-up Simon Link Allow Do not Deny Any Orders, Deny All & lt; / Directory & gt;   

2. Add Open httpd-vhost.conf and Add:

  ## & lt; / VirtualHost & gt; & Lt; VirtualHost Name: 80 & gt; DocumentRoot C: / xampp / htdocs / wwwroot / & lt; Directory "C: / xampp / htdocs / wwwroot /" & gt; Follow options indexSim Links include FCSGI Allowoverride Allow all orders, deny permission from everyone & lt; / Directory & gt; ServerAdmin (any@email.com) ServerName (IP address or FQDN) & lt; / VirtualHost & gt; 3. The most important step is to add an exception to the port used on Windows Firewall (80 in this example).  

Hope this helps :)

No comments:

Post a Comment