access wordpress site from another machine

I’am new to the WordPress and I created WordPress website and configure it within the Wamp Server. The site displays all it’s contains locally correctly. Now I want to access that website from the another machine within same network but it did not display all the contents correctly. it displays only the text. no images and the applied theme is not displays. I turn off the firewall and change the Apache configuration file (httpd.config) as follows. but it also didn’t work properly. please help me.

Read More

Order allow, deny

Allow from all

Related posts

3 comments

  1. The problem is that you specify during install that the hostname of the site is “localhost“. Unofrtunately when you connect from another computer the link to “localhost” refers to the pc you are connecting from and since in this pc there isn’t any server runnin,g you see only the text and not the images or the css.
    The solution is to modify the wp-config.php wordpress file and change this from:

    define('DB_HOST', 'localhost');
    

    to:

    define('DB_HOST', '192.168.0.4');
    
  2. The problem is with URL of the site. You need to update the URL in database and replace localhost with IP of your machine using phpmyadmin and then that site will be accessible from other machines in your network. Please try this and it will solve your problem.

  3. This is a WordPress oddity. When you install WP on localhost, or anywhere, it stores the url used in the install in its database. It then uses this url internally in its code to build links etc.

    So when you come to run this site from another PC, things like image links will be built with the url localhost or localhost/wordpress.

    Now when you run this from another PC using a different URL like 192.168.0.4/wordpress localhost will still appear in the links and of course there is no localhost on the client PC. So the links dont work. Its a bit like you have moved your site to a new url, but WP does not know about it.

    Read this post on the WP Codex to work out what you need to so to amend the urls in the database. OF course this means you wont be able to use localhost anymore on the WAMPServer machine either.

Comments are closed.