www.webdeveloper.com
Results 1 to 2 of 2

Thread: Segmentation fault when accesssing DB

  1. #1
    Join Date
    Sep 2006
    Location
    Copenhagen, Denmark
    Posts
    1,253

    Segmentation fault when accesssing DB

    Hello brave developers


    I'm getting a segmentation fault using the following script
    PHP Code:
    $dbconn pg_pconnect("host=localhost port=5432 dbname=someDB user=someUser password=somePass") or die('Dbconnect failed!'); 
    but only when I run the script from the console as in
    Code:
    /usr/bin/php -f /var/www/test.php
    If I modify the script slightly to
    PHP Code:
    print "Before DB connect\n";
    $dbconn pg_pconnect("host=localhost port=5432 dbname=someDB user=someUser password=somePass") or die('Dbconnect failed!');
    print 
    "After DB connect\n"
    then the output becomes
    Code:
    Before DB connect
    After DB connect
    Segmentation fault
    So it seems the script is being executed. The segmentation fault only happens when I have to access the database. Can anyone explain what is going on?
    #define question (2B || !2B)
    HTMLElement and W3C Event Handling in IE
    My JavaScript Library

    Don't PM me about answers to questions. If I don't reply in a thread it's because:
    • You didn't read the message posting guidelines
    • Your code is too unstructured and/or formatted poorly - correcting it is too time consuming
    • I simply don't know the answer

  2. #2
    Join Date
    Sep 2006
    Location
    Copenhagen, Denmark
    Posts
    1,253
    It seems to be a bug in PHP. I have filed a bug report http://bugs.php.net/bug.php?id=45609. Hopefully Google can pick up this thread so other people won't waste time trying to correct this.
    #define question (2B || !2B)
    HTMLElement and W3C Event Handling in IE
    My JavaScript Library

    Don't PM me about answers to questions. If I don't reply in a thread it's because:
    • You didn't read the message posting guidelines
    • Your code is too unstructured and/or formatted poorly - correcting it is too time consuming
    • I simply don't know the answer

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles