Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I have a fresh Joomla installation in a Mac OS X and I have configured a database to connect the application to. By default, Joomla uses localhost to connect (variable $host), but it does not work.

However, if I replace localhost with 127.0.0.1 it does connect. I have installed MySQL using MacPorts.

It seems this is the opposite problem asked in another question.

What can I do to be able to use localhost instead of plain IP?

Here is my /etc/hosts content:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost

Thanks!!

share|improve this question

1 Answer 1

Add

127.0.0.1 localhost

To the hosts file, found at this location

/private/etc/hosts

Save the hosts file and restart your web server. The hosts file maps IP addresses, such as 127.0.0.1, with hostnames, such as localhost.

Here is a tutorial on the Mac hosts file.

share|improve this answer
    
As you can see in my question update, my /etc/hosts had that line already :) –  elitalon Jul 1 '11 at 22:26

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.