MyBB Community Forums

Full Version: [PostgreSQL][lighttpd]Connection is failing
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hi,

i changed my Server from apache to lighttpd and then the forum didn't worked any more. I only got the message
[READ] Unable to connect to PgSQL server
. Some other websites worked completely.
I had to let show the connectionstring and there was the failure. I had localhost as host in the config and that bit is not in the string, but it has to be there at the first position of the string.
This is a problem with your configuration, not MyBB.
I thought so too, but why is it then working with localhost as host given? Why is it ignored in the code anyway?
The php.ini is exactly the same for cgi and the apachemodule, so that can't be the reason. And whether in the apache config nor in the lighttpd config is any point which says, behave in another way.
And with the host given in the connectionstring, it is working.

I tried to only allow Socket Connections und TCP/IP Connections and nothing works, because localhost is not given in the connection string. That can't be corrent, because the documentation says, that when no host is given, it looks after an unix socket.
I think I've seen this problem before. In inc/db_pgsql.php, if you change
if($single_connection['hostname'] != "localhost")
to
if(true)
then it works?
Yes, I changed that and now it works.
Sorry that I pull up this thread, but do you have an idea, what can be the cause of this failure? Or are you trying to fix this?
Apparently PostgreSQL on lighttpd requires the hostname directive, but apache doesn't. Not sure if this is a bug with lighttpd or not, but I'd say it should default to localhost if nothing is selected which is the documented behavior of the postgresql connect function.
Do you plan to do something here? The failure is present in 1.4.5 too and it behaves like before.
No because this isn't a MyBB bug; It's a lighthttpd/PostgreSQL problem. You can either use a different hostname than localhost or apply dennis's workaround: http://community.mybboard.net/thread-426...#pid290120

Ryan
No, it is definitly a failure of mybb, because I have testet it on apache now, with mybb 1.4.5 and I got exactly the same failure.
The hostname has to be given, apart of whether it is a network connection or a socket connection.
If you don't believe me, try it out yourself.
Pages: 1 2