FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » php and PDO Error HTTP 500
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
php and PDO Error HTTP 500 [message #179130] Fri, 14 September 2012 09:09 Go to previous message
Une Bvue[1] is currently offline  Une Bvue[1]
Messages: 9
Registered: September 2012
Karma:
Junior Member
I get this http error 500 within a page when i want to connect to a
postgresql database.
This database is working well in command line ($ psql ...)

Although i got an error message using the php script :
yt@D620 /home/yt/Sites/yt_tests $ php index.php

PHP Fatal error: Uncaught exception 'PDOException' with message
'SQLSTATE[08006] [7] server closed the connection unexpectedly
This probably means the server terminated abnormally
before or while processing the request.' in
/home/yt/Sites/yt_tests/index.php:75
Stack trace:
#0 /home/yt/Sites/yt_tests/index.php(75):
PDO->__construct('pgsql:dbname=yt...', 'yt', 'yvon5533')
#1 {main}
thrown in /home/yt/Sites/yt_tests/index.php on line 75
zsh: exit 255 php index.php

line 75 being :
$db = new PDO("pgsql:dbname=$dbname;host=$host;", $username, $password );

i do not got any php error when connecting thru a browser.

everything is installed for PDO / PostgreSQL following my info.php page :
Additional .ini files parsed /etc/php5/apache2/conf.d/curl.ini,
/etc/php5/apache2/conf.d/pdo.ini,
/etc/php5/apache2/conf.d/pdo_pgsql.ini,
/etc/php5/apache2/conf.d/pgsql.ini, /etc/php5/apache2/conf.d/xsl.ini

PDO

PDO support enabled
PDO drivers pgsql

pdo_pgsql

PDO Driver for PostgreSQL enabled
PostgreSQL(libpq) Version 9.1.5
Module version 1.0.2
Revision $Id: pdo_pgsql.c 321634 2012-01-01 13:15:04Z felipe $

pgsql

PostgreSQL Support enabled
PostgreSQL(libpq) Version 9.1.5
Multibyte character support enabled
SSL support enabled
Active Persistent Links 0
Active Links 0

Directive Local Value Master Value
pgsql.allow_persistent On On
pgsql.auto_reset_persistent Off Off
pgsql.ignore_notice Off Off
pgsql.log_notice Off Off
pgsql.max_links Unlimited Unlimited
pgsql.max_persistent Unlimited Unlimited


I don't undertand this prob.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: log of all php's connection
Next Topic: How expensive is glob'ing a dir and including all the files?
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 17:02:02 GMT 2024

Total time taken to generate the page: 0.04560 seconds