-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Seg Fault when used with php8.2 or php8.3's pdo-odbc module & SSL #2
Comments
Adding more information as I recently encountered this issue while transitioning a project to a docker container. The content of the php file: <?php
$dbname = XX.XX.XX.XX/4315?ssl=true?serverPublicFile=/opt/interbase/ibservercafile.pem??:C:\Multidev\Gdbcreation\SV1020_012HO_LAB.GBB';
$connection_string = "odbc:Driver=InterBase;".
"Dbname=".$dbname.";".
"User=SYSDBA;".
"Password=masterkey;".
"Role=;".
"CharacterSet=NONE;".
"ReadOnly=No;".
"NoWait=Yes;".
"Dialect=1;".
"QuotedIdentifier=Yes;".
"SensitiveIdentifier=No;".
"AutoQuotedIdentifier=No";
print_r('1' . PHP_EOL);
$dbh = new PDO($connection_string); \\ crashes here
print_r('2' . PHP_EOL);
$dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
print_r('3' . PHP_EOL);
$dbs = $dbh->prepare("select * from databaseid");
print_r('4' . PHP_EOL);
$result = $dbs->execute();
print_r('5' . PHP_EOL);
print_r($result); The same test works with UnixODBC with the following config file:
|
Here is the Dockerfile and related files to create a container that replicates this problem. In the root of the folder: FROM ubuntu:24.04 AS ubuntu
LABEL authors="multidev"
ARG DEBIAN_FRONTEND=noninteractive
WORKDIR /var/www/html
RUN apt update && apt install -y software-properties-common
RUN add-apt-repository ppa:ondrej/php
RUN add-apt-repository ppa:ondrej/apache2
RUN apt install -y \
zip \
libzip-dev \
supervisor \
nano \
htop \
wget \
unixodbc \
odbcinst \
unixodbc-dev \
libbz2-dev \
curl \
libcurl4-openssl-dev \
libpng-dev \
libicu-dev \
libonig-dev \
libedit-dev \
libreadline-dev \
libxml2-dev \
libxslt1-dev \
libjpeg-dev \
libfreetype6-dev \
libmcrypt-dev \
libssl-dev \
libsqlite3-dev \
fontconfig \
neovim \
apache2 \
apache2-utils
RUN apt install -y \
php8.1 \
php8.1-bcmath \
php8.1-bz2 \
php8.1-cli \
php8.1-common \
php8.1-curl \
php8.1-gd \
php8.1-intl \
php8.1-mbstring \
php8.1-mysql \
php8.1-readline \
php8.1-soap \
php8.1-sqlite3 \
php8.1-xml \
php8.1-zip \
php8.1-odbc
COPY . .
# Interbase Install
RUN wget https://altd.embarcadero.com/download/interbase/2020/Update6/InterBase_2020_Linux.zip
RUN unzip InterBase_2020_Linux.zip -d ./Interbase
RUN cd ./Interbase && \
chmod +x ./install_linux_x86_64.sh && \
./install_linux_x86_64.sh -f ../src/php-interbase/deps/client_values.txt || true
RUN rm -r Interbase
RUN rm InterBase_2020_Linux.zip
RUN ln -s /usr/lib64/libgds.so /usr/lib/libgds.so || true
RUN rm /usr/local/bin/docker-entrypoint || true
RUN mv docker/entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
RUN mv docker/supervisord.conf /etc/supervisor/conf.d/supervisord.conf
# ODBC Install
RUN mkdir ./src/php-interbase/deps/odbc
RUN tar -xvf ./src/php-interbase/deps/OdbcIB-1.0.0.107.tar.gz -C ./src/php-interbase/deps/odbc
RUN cd ./src/php-interbase/deps/odbc/ && ./install.sh || true
RUN rm -r ./src/php-interbase/deps/odbc
RUN mv docker/odbcinst.ini /etc/odbcinst.ini
EXPOSE 80
ENTRYPOINT ["docker-entrypoint.sh"]
CMD ["/usr/bin/supervisord"] The referred #!/bin/sh
exec "$@"
[InterBase]
Description = InterBase ODBC driver
Driver = /usr/lib/libOdbcIB.so
UsageCount = 1
[supervisord]
nodaemon=true
logfile=/dev/null
logfile_maxbytes=0 You will also need the following file for it to work which is your internal packaged version of this project: |
I set up my certificates as described here:
https://docwiki.embarcadero.com/InterBase/2020/en/Setup_OTW/SSL_and_InterBase#Requesting_a_key
It has been running fine under PHP8.1 but our attempts to upgrade to 8.2 this morning resulted in segfaults when the PDO object is instantiated.
Connection string passed to PDO with 8.2:
odbc:Driver=InterBase;Dbname=XX.XX.XX.XX/4315?ssl=true?serverPublicFile=/opt/interbase/ibservercafile.pem??:C:\PATH\TO\DB.GDB;User=SYSDBA;Password=PASSWORD;Role=;CharacterSet=NONE;ReadOnly=Yes;NoWait=Yes;Dialect=1;QuotedIdentifier=Yes;SensitiveIdentifier=No;AutoQuotedIdentifier=No
With the following connection string without SSL it work though:
odbc:Driver=InterBase;Dbname=XX.XX.XX.XX/3050:C:\PATH\TO\DB.GDB;User=SYSDBA;Password=PASSWORD;Role=;CharacterSet=NONE;ReadOnly=Yes;NoWait=Yes;Dialect=1;QuotedIdentifier=Yes;SensitiveIdentifier=No;AutoQuotedIdentifier=No
Version:
Please let me know if you need more information.
The text was updated successfully, but these errors were encountered: