Web lists-archives.com

Re: Re: how to force mysql to use the name of my machine instead of localhost




Thanks for reply;
I give more details.
I install wordpress on my machine, it works fine on local,  I mean i if write in the browser localhost/wordpress, it 's OK.

I can use myIP/worpress on a remote  machine to connect my server, It seems working  fine, I get the main page,
BUT, CSS files are not read, I know that by prospecting the code source of the page.

Wordpress store everything in database,  and so the name of the CSS file for example, unfortunatly,  the path  used is full address of the file like
localhost/wordpress/blabla/style.css
here is the Big Problem

When the connection is local, no problem, since localhost is the host of the server;

when the connection is  like :   http://myURL/wordpress,   we SHOULD FIND the CSS file with  http://myURL/wordpress/blabla/style.css



 To solve the problem
  • either  we remove the absolute path for the files, and keep only  the relative part,  instead of storing  localhost/wordpress/blabla/style.css, we keep only wordpress/blabla/style.css
  • or we replace the localhost by the name of the machine or IP, that is what I want to do, I mean instead of storing in DB, localhost I tore the name of my machine like bela.enst.dz, the connetion w'll be done with this name and the problem is then solved

I used xampp to install apache, mysql and php. But the problem is the same when I installed each element alone ( apache2, php, mysql)


when I used the command : localhost -f , I got the correct name
tmp$ hostname -f
bela.enst.dz

thanks a lot for any idea

Regards

bela