Skip to content

Commit 4dd1205

Browse files
committed
Working php82 pgsql
1 parent c494faa commit 4dd1205

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ RUN set -ex \
1616
openssl \
1717
postgresql \
1818
postgresql-dev \
19+
php82=8.2.16-r0 \
1920
php82-pdo_pgsql=8.2.16-r0 \
2021
jpeg-dev \
2122
libpng-dev \
@@ -43,5 +44,5 @@ USER nobody
4344
# Expose the port nginx is reachable on
4445
EXPOSE 8080
4546

46-
# Let supervisord start nginx & php-fpm
47+
# Let supervisord start nginx + octane
4748
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"]

testpdo.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
<?php
2+
$dsn = 'pgsql:host=host.docker.internal;port=5432;dbname=postgres';
3+
try {
4+
$pdo = new PDO($dsn, 'postgres', 'password');
5+
echo "Connected successfully";
6+
} catch (PDOException $e) {
7+
echo "Connection failed: " . $e->getMessage();
8+
}

0 commit comments

Comments
 (0)