Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

My PHP web app is crashing upon calling pg_connect when running on my Mac OS X machine ( it does not crash from a RHEL8 server ).

It's only happening when:

  • Connecting to a PostgreSQL 15 database server and
  • When running in Apache HTTPD (through CLI it works fine).

Meaning the script works when I run it from the CLI and it fully works (CLI and Apache HTTPD) when connecting to another PostgreSQL server running PostgreSQL 9.0 (it only crashes when attempting to connect to a PostgreSQL 15 server).

On my local machine I'm running PHP 7.4.33

When I run the crashing script in Apache HTTPD, the error_log shows me this:

[Sat Nov 09 12:25:42.609490 2024] [core:notice] [pid 39732] AH00052: child pid 51781 exit signal Segmentation fault (11)

The script is extremely simple:

<?php
$connString="host=<host> port=<port> user=<username> password=<password> dbname=<dbname> sslmode=disable";
$conn = pg_connect($connString);
echo "conn: [". print_r($conn)."]";
?>

The output of phpinfo() is as follows (only including the relevant pgsql parts):

pgsql
PostgreSQL Support enabled
PostgreSQL(libpq) Version 16.3
PostgreSQL(libpq) PostgreSQL 16.3 on aarch64-apple-darwin23.4.0, compiled by Apple clang version 15.0.0 (clang-1500.3.9.4), 64-bit
Multibyte character support enabled
SSL support enabled
Active Persistent Links 0
Active Links 0

The error logs don't give me any info besides the segmentation fault. I have tried with both sslmode=disable and without to no avail.

I have tried this against 2 different sets of PostgreSQL v15.x servers (one a 15.8 and another on 15.9) and they both give the same results.

I have tried this with the following PHP versions and they all give the same result for all of them:

  • 5.6
  • 7.1
  • 7.2
  • 7.3
  • 7.4
  • 8.0
  • 8.1
  • 8.4
  • 8.5-dev

Are there any other troubleshooting I can do to pinpoint the exact problem or any additional info I can give ?

thank you

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant
Morty Proxy This is a proxified and sanitized view of the page, visit original site.