0

I want to add pgsql extension to php in Centos 6.

I've tried uncommenting these lines in my php.ini file with no luck:

extension=php_pdo_pgsql.dll
extension=php_pgsql.dll
thor
  • 21,418
  • 31
  • 87
  • 173
Mohsen Abasi
  • 2,050
  • 28
  • 30

2 Answers2

1

You've uncommented the windows configuration lines, but you're on a unix system. Uncomment (or add) this line:

extension=pdo_pgsql.so
Alex Howansky
  • 50,515
  • 8
  • 78
  • 98
0

Execute the following commands:

 $ yum install postgresql-devel
 $ pecl download pdo_pgsql
 $ tar xzf PDO_PGSQL-1.0.2.tgz
 $ ./configure --with-pdo-pgsql=/usr/pgsql-9.5
 $ make
 $ sudo make install

Now check that a

*pgsql.so

file exists in the directory:

/usr/lib64/extensions/no-debug-non-zts-20100525/

and also extension_dir of php.ini file is set on this directory. If you want to know the exact path of your php.ini file, create a simple PHP file, in your Apache htdocs or var/www directory, with the following content:

<?php echo 'ini: ', get_cfg_var('cfg_file_path');
?>

And then browse it. Finally add one line to your php.ini file:

extension=pdo_pgsql.so
halfer
  • 19,824
  • 17
  • 99
  • 186
Mohsen Abasi
  • 2,050
  • 28
  • 30