A place to breathe

Sunday, January 10, 2016

Unable to connect to PostgreSQL server

I recently installed PostgreSQL on my server and trying out their configurations. All these while, I just play with MySQL. For some reason, I decided to use PostgreSQL for my current project.

PostgreSQL come with a user called postgres . If you want to use it with PHP, you might end up using the following from its documentation:

$dbconn2 pg_connect("host=localhost port=5432 dbname=mary");


Bad news, it doesn't work on me.

pg_connect(): Unable to connect to PostgreSQL server: FATAL: Ident authentication failed for user

To fix the error, all you need to do is to omit the "host" and the port parameter so that you just use something like this:

$dbconn2 pg_connect("dbname=mary user=postgres password="yourpassword");







Monday, January 4, 2016

How to install PHP packages with broken dependencies

Cent OS 6 is stable. Most of the people are familiar with it. So I decided to use the Cent OS 6 instead of Cent OS 7. I'm an middle-age ( i mean, mid 30s) software engineer. I don't want too much risk.

Assuming you've upgraded your repositories to Remi. For example, I want to install a PHP PostgreSQL.

sudo yum install php-pgsql 
 
If you get the following error:

Requires: php-common(x86-64) = 5.4.45-2.el6.remi
           Installed: php-common-5.5.30-1.el6.remi.x86_64 (@remi-php55)



You need to issue the following instead:

sudo yum --enablerepo=remi-php55 install php-pgsql 


Friday, January 1, 2016

Welcome to 2016

Hello 2016 !

Welcome to an exciting journey !  I can't wait to explore so many things this year.
2015 has been rough but rewarding. I thank God for everything wonderful in 2015.



About Me

I'm currently a software engineer. My specific interest is games and networking. I'm running software company called Nusantara Software.