When logging on to phpPgAdmin: If you always get a "Login failed" and confirm that you have used the correct username and password and can log on normally in pgadminIII! Solution: Modify php. in the ini configuration file, set extension = pgsql. so it is OK to comment out this line. The changed form is as follows:; For example:; extension = msql. so; extension = pgsql. so this is very simple, but I did not find a solution on the Internet for a day. I only need to carefully check the php. in ini, we can see that all the mysql configurations in one line are commented out. Take a try and put pgsql. so is also commented out. Haha, it's a pleasure to be successful! After the change, the problem that the postgresql-connected program previously written in php cannot be connected is also solved. Attached test code: // connection, select database $ dbconn = pg_connect ("host = localhost dbname = testdb user = lyb password = dbmanage "); // see if our connection was successful if (! $ Dbconn) {// connection failed-exit the page with an error // you cocould also try to proceed without the // database-it's up to you echo "connection failed, cannot connect to Database "; exit;} else {echo" connection successful ";} echo"
Php configuration details: "; echo phpinfo (); // close the connection pg_close ($ dbconn);?> Note: My environment is: CentOS4.4 apache and php both come with postgresql 8.1 (compiled and installed by yourself)