pmilosev Posted June 10, 2006 Share Posted June 10, 2006 HiI've installed Postgre for first time and tried to connect php<?php echo "1"; pg_connect("host=localhost ..."); echo "2";?>I was expecting an error on the connection string maybebut all I got was1... I tried several times with different connection strings ... and aways php stoped on pg_connecthelp ?thx Quote Link to comment https://forums.phpfreaks.com/topic/11630-connection-problem/ Share on other sites More sharing options...
neylitalo Posted June 10, 2006 Share Posted June 10, 2006 Good choice! I love Postgres - it's much more powerful than MySQL.May I suggest the ADOdb library? It's a PHP library that gives you an ultra-easy way to interface with nearly any database system on the planet, and it's very powerful. [a href=\"http://adodb.sourceforge.net\" target=\"_blank\"]http://adodb.sourceforge.net[/a].Regardless of your decision to use ADOdb or not, you'll want to check these things:[list][*]Make sure that Postgres is running. If you're running Windows, it's probably in your Services list, and if you're running *nix, then you can run "ps ax | grep postgres" to see if there are any postgres processes.[*]Make sure that your PHP has postgres support enabled. In Windows, you need to uncomment the appropriate line in php.ini - in Unix, you need to compile php --with-pgsql.[*]And make sure your connect string is correct for your server, if the above two are taken care of.[/list] Quote Link to comment https://forums.phpfreaks.com/topic/11630-connection-problem/#findComment-43908 Share on other sites More sharing options...
eawf Posted June 10, 2006 Share Posted June 10, 2006 Check your Error Logs for the actual PHP error.Also, instead of writing the connect code, use Justin Vincent's ez_SQL database wrapper. Makes database interactions rediculously simple.[!--quoteo(post=382122:date=Jun 10 2006, 01:30 AM:name=PC-SandMan^^)--][div class=\'quotetop\']QUOTE(PC-SandMan^^ @ Jun 10 2006, 01:30 AM) [snapback]382122[/snapback][/div][div class=\'quotemain\'][!--quotec--]HiI've installed Postgre for first time and tried to connect php<?php echo "1"; pg_connect("host=localhost ..."); echo "2";?>I was expecting an error on the connection string maybebut all I got was1... I tried several times with different connection strings ... and aways php stoped on pg_connecthelp ?thx[/quote] Quote Link to comment https://forums.phpfreaks.com/topic/11630-connection-problem/#findComment-43926 Share on other sites More sharing options...
pmilosev Posted June 10, 2006 Author Share Posted June 10, 2006 thx a lotdummy mistake .... I didn't include postgreSQL ext in my php.inithx Quote Link to comment https://forums.phpfreaks.com/topic/11630-connection-problem/#findComment-44037 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.