Thursday, November 17, 2011

PostgreSQL - Fatal error: Call to undefined function pg_connect() - Solved

If anyone using PostgreSQL may encounter Fatal error: Call to undefined function pg_connect() initially. This is because the PostgreSQL module has not been initialized properly. I will tell you the steps for setting up PostgreSQL module in xampp

  1. Open php.ini 
  2. Find ;extension=php_pgsql.dll and replace the initial semi colon
  3. Find ;extension=php_pdo_pgsql.dll and replace the initial semi colon 
  4. Save the file
  5. Restart apache

Done !!
Share, if it helps you...

Running PHP5 in XAMPP - Solved

Similar Problem - I have installed XAMPP on a Windows machine but cannot seem to get my PHP5 extensions working. If I go to a page http://localhost/contact.php everything displays fine but if I change the filename to contact.php5 and then try to browse to http://localhost/contact.php5 all I see is my code. My host requires me to specify the .php5 file extension. I've installed XAMPP Apache server and put my website into htdocs. I've started Apache server. On my website I've got files with extension PHP and with extension PHP5.The difference is that when I type in into browser localhost/file.php - I see a parsed website. But when I type localhost/file.php5 (i have this file on server), than browser asks me if I want to download or open this file. And if I choose open than I see PHP code of file.php5!

If you also have trouble in running php5 files in Xampp. Then this will help you. 

  1. Open C:\xampp\apache\conf\extra\httpd-xampp.conf file in text editor
  2. Below LoadModule php5_module modules/php5apache2_2.dll
    You can see,

    SetHandler application/x-httpd-php

    SetHandler application/x-httpd-php-source
  3. Replace the above set with the below one,

    SetHandler application/x-httpd-php

    SetHandler application/x-httpd-php-source
  4. Find this set of code,

    AddType text/html .php .phps
  5. Replace the above set with this one,

    AddType text/html .php .phps .php5
  6. Done !!!
    Share, if it works.

Popular Posts