Unable to connect to PostgreSQL server: could not connect to server: Permission

When running a php page from the browser a connect ion to Postgresql is denied even when it can be  accessed by pgadmin normally.

1- Run the php page from the prompt, for example, if page is named: conntest.php:

php /var/www/html/conntest.php

If it is sucessful then Apache is probably being blocked by SElinux.

2-

#gedit /etc/selinux/config

 

 

disable SElinux and reboot... congratulations, now it is working.

你可能感兴趣的:(apache,html,PHP,PostgreSQL)