开发者

I'm getting a blank screen when trying to connect Codeigniter to postgresql

I'm using codeigniter 1.7.2 on WAMP with php_pgsql and php_pdo_pgsql extensions enabled here is my configuration :

$active_group = "default";
$active_record = TRUE;
$db['default']['hostname'] = "localhost";
$db['default']['username'] = "postgres";
$db['default']['password'] = "mypassword";
$db['default']['database'] = "mydatabasename";
$db['default']['dbdriver'] = "Postgre";
$db['default']['dbprefix'] = "";
$db['default']['pconnect'] = TRUE;
$db['default']['db_debug'] = TRUE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = "";
$db['default']['char_set'] = "utf8";
$db['default']['dbcollat'] = "utf8_general_ci";

when i open my application in a web browser all the existing urls return empty page when i view the source there is nothing What am i missing ?

Edit after cheking wamp log i found this :

[Tue Jul 13 23:30:05 2010] [notice] Parent: Created child process 4944 PHP Warning: PHP Startup: Unable to load dyna开发者_Go百科mic library 'c:/wamp/bin/php/php5.3.0/ext/php_pgsql.dll' - The specified module could not be found.\r\n in Unknown on line 0

Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.0/ext/php_pgsql.dll' - The specified module could not be found. in Unknown on line 0

[Tue Jul 13 23:30:05 2010] [notice] Child 4944: Child process is running

any idea how to solve this ?


I think you must change Postgre to postgres, lowercase with a trailing s (per manual: http://codeigniter.com/user_guide/database/configuration.html).

There might be other problems. Are interesting PHP errors in the Apache logs?


I'm running WAMP 2.2 on Windows 7 64 bit with POSTGRES 9.1, and adding the LoadFile line to httpd.conf cured the "blank page" syndrome with Codeigniter entirely:

<VirtualHost 127.0.0.1>
LoadFile "C:/Program Files/PostgreSQL/9.1/bin/libpq.dll"
ServerName localhost
DocumentRoot "C:/wamp/www"
</VirtualHost> 

Naturally, if you are not using Postgres 9.1, or your path to the .dll is different in some way, edit the LoadFile directive accordingly.


Turn off pconnect and see if that works out.


Anyway i installed WAPP and everything works fine now i think the php_pgsql.dll was not compatible with PHP 5.3


Check if the DLL ("c:/wamp/bin/php/php5.3.0/ext/php_pgsql.dll") referred in the apache error log really exists. If it does then look into this answer.


enable php_pgsql extension from system tray => wamp icon => PHP => PHP Extensions => php_pgsql.

This solved my problem.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜