Postgres php segfault

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • IDK

    #1

    Postgres php segfault

    I have the following code:
    <?
    #!/usr/bin/php-cgi -e

    $dbconn = pg_pconnect("ho st=localhost dbname=zerus ".
    "user=zuser password=1")
    or die('Could not connect: ' . pg_last_error() );

    pg_close($dbcon n);
    echo "B"
    ?>
    *************** *************** *************** ******
    And I get the following output:
    X-Powered-By: PHP/5.2.3-1+b1
    Content-type: text/html

    BSegmentation fault

    I'm using the php 5.2.3-1+b1 and postgres 8.2.4-2.

    This has to be some destruction fault with postgres/php...

    I don't get any message when I use mod_php...

    Is there any fix or does someone know why this happens?

  • Toby A Inkster

    #2
    Re: Postgres php segfault

    IDK wrote:
    This has to be some destruction fault with postgres/php...
    What happens using plain old pg_connect?

    --
    Toby A Inkster BSc (Hons) ARCS
    [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
    [OS: Linux 2.6.12-12mdksmp, up 19 days, 21:42.]

    demiblog 0.2.0 Released

    Comment

    • IDK

      #3
      Re: Postgres php segfault

      On Jul 10, 8:03 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
      wrote:
      IDK wrote:
      This has to be some destruction fault with postgres/php...
      >
      What happens using plain old pg_connect?
      >
      --
      Toby A Inkster BSc (Hons) ARCS
      [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
      [OS: Linux 2.6.12-12mdksmp, up 19 days, 21:42.]
      >
      demiblog 0.2.0 Released
      http://tobyinkster.co.uk/blog/2007/0...emiblog-0.2.0/
      Nice thought, but it gives the same error...

      I didn't get this error like yesterday.
      I did change some configuration files the day before yesterday,
      so I removed all config files and uninstalled php-cgi,
      and then reinstalled, just to be sure, but the segfault persists...

      Comment

      • Toby A Inkster

        #4
        Re: Postgres php segfault

        IDK wrote:
        I didn't get this error like yesterday.
        Does this script output the same in both mod_php and php-cgi?

        <?php
        echo posix_getuid(). "\n";
        echo posix_getgid(). "\n";
        echo posix_geteuid() ."\n";
        echo posix_getegid() ."\n";
        echo get_cfg_var('ex tension_dir')." \n";
        echo phpversion()."\ n";
        echo phpversion('pgs ql')."\n";
        ?>

        --
        Toby A Inkster BSc (Hons) ARCS
        [Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
        [OS: Linux 2.6.12-12mdksmp, up 20 days, 17:17.]

        demiblog 0.2.0 Released

        Comment

        • IDK

          #5
          Re: Postgres php segfault

          On Jul 11, 3:50 pm, Toby A Inkster <usenet200...@t obyinkster.co.u k>
          wrote:
          IDK wrote:
          I didn't get this error like yesterday.
          >
          Does this script output the same in both mod_php and php-cgi?
          >
          <?php
          echo posix_getuid(). "\n";
          echo posix_getgid(). "\n";
          echo posix_geteuid() ."\n";
          echo posix_getegid() ."\n";
          echo get_cfg_var('ex tension_dir')." \n";
          echo phpversion()."\ n";
          echo phpversion('pgs ql')."\n";
          ?>
          >
          When I run the script with mod_php I get the following output:
          #!/usr/bin/php-cgi 33 33 33 33 5.2.3-1+b1

          And then take a look at the following session:

          idk@scaleo:/var/www/zerus$ ./test2
          X-Powered-By: PHP/5.2.3-1+b1
          Content-type: text/html

          1000
          1000
          1000
          1000

          5.2.3-1+b1


          idk@scaleo:/var/www/zerus$ sudo su www-data
          sh-3.1$ ./test2
          X-Powered-By: PHP/5.2.3-1+b1
          Content-type: text/html

          33
          33
          33
          33

          5.2.3-1+b1


          sh-3.1$ ./test
          X-Powered-By: PHP/5.2.3-1+b1
          Content-type: text/html


          Segmentation fault
          sh-3.1$



          Which means that group id and user id doesn't matter...

          The other values are as you see null, which cannot be good...

          Comment

          Working...