Jump to content

Php Styles Fail.

Recommended Posts

I setup a Apache server on my Linux box and plan to use it to learn php, I have been meaning to learn for a while. First I would like the server working. I don't want it remote accessible(on the web) yet but I would like to be able to access it throughout my house on all my machines. I type in [localip/wordpress] and it takes me to the site, but it is quite ugly. from what I know of html and css it looks like its missing a style sheet or something. It works fine on the server but on my other boxes that's what i get. Any ideas how to fix it? I uploaded a pic at the bottom of what I'm getting.


Link to comment
Share on other sites

In the source (ctrl+U) it keeps referencing, which is fine for the server, but if its looking on my other box for that it wont find it. Im searching through the wp-config.php to see what i can do. Clicking links also takes me to so i really think its some sort of linking problem, anyone know how to get it to instead of going to 127.0.x.x to get to to go to the local ip of my box?

Edited by KenShin133
Link to comment
Share on other sites

If trying to reach it from other boxes, you need to use the Linux machines IP address of the one running wordpress, not = locahost. In otherwords, 127.x.x.x is only the local machine itself. So thats why when you are on the linux box, you can see everything fine. If the apache server hosting wordpress has anything pointing to for its files, such as the stylesheet, etc, then when trying to connect from a different machine, any file references as localhost or will try to pull it from the local machine, where the resources don't reside.

in the linux machine, open a terminal and type ifconfig -a and look at its local ip address for its adapter. Then from the other boxes, navigate to that address. For example, if the linux box ip address is, then from another machine open your browser and go to

If they stylesheet still doesn't show up, then most likely your theme source files is pointing only to localhost of the linux box, and when another machine connects, its trying to pull the stylesheet from itself, instead of the linux box. Thats my guess. Try switching themes and see if it works afterwards.

Edited by digip
Link to comment
Share on other sites

Thanks, i knew about the 127.X thing but I just don't know how to fix it. But but i did is i deleted it all and started from scratch. I will take more time this time and keep tack of the places that say localhost and otherwise. would it be acceptable to change ALL "localhost" statements to the internal IP? or would that mess with the server?

Link to comment
Share on other sites

Why would you be referencing local host anyway? You can reference, read 'link', to other pages by using your current directory and deeper into the directory.

For example:

<link rel="stylesheet" type="text/css" href="style/style.css"

With said code above, your stylesheet 'style.css' would be located in the style folder, which would be inside the root of your website's directory that Apache is being pointed at. Apache knows what directory you're in and reads information from that directory. So to say, link to another page of the site, you would simply:

<a href="otherPage.html">Other Page</a>

Hope that helps, if not, I'll try to explain in more detail.

P.S. Never give up! Don't start over if you don't have to! Most problems, outside of Windows(hehe), can be fixed without a complete wipe =) And to be honest, I haven't had to do a complete reinstall of Windows in quite a while, =).

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...