Comments (16)
Well the pdo package should be installed OK, I'd check the output of phpinfo to see if there is something screwy like duplicate php.ini files, this stack overflow has some suggestions:
http://stackoverflow.com/questions/11813381/php-fatal-error-class-pdo-not-found
from nginx-php-fpm.
Had a look in phpinfo - there is only one php.ini file: /etc/php7/php.ini
There is a path for additional ini files in: /etc/php7/conf.d containing:
/etc/php7/conf.d/00_ctype.ini, /etc/php7/conf.d/00_curl.ini, /etc/php7/conf.d/00_exif.ini,
/etc/php7/conf.d/00_gd.ini, /etc/php7/conf.d/00_iconv.ini, /etc/php7/conf.d/00_intl.ini,
/etc/php7/conf.d/00_json.ini, /etc/php7/conf.d/00_mcrypt.ini, /etc/php7/conf.d/00_mysqli.ini,
/etc/php7/conf.d/00_openssl.ini, /etc/php7/conf.d/00_pdo.ini, /etc/php7/conf.d/00_pdo_mysql.ini,
/etc/php7/conf.d/00_pdo_pgsql.ini, /etc/php7/conf.d/00_pgsql.ini, /etc/php7/conf.d/00_session.ini,
/etc/php7/conf.d/00_sqlite3.ini, /etc/php7/conf.d/00_xml.ini, /etc/php7/conf.d/00_zip.ini,
/etc/php7/conf.d/00_zlib.ini, /etc/php7/conf.d/01_dom.ini, /etc/php7/conf.d/01_mysqlnd.ini,
/etc/php7/conf.d/01_phar.ini, /etc/php7/conf.d/01_xsl.ini
Note that the database is on an external container (mariab image). Could this cause problems?
from nginx-php-fpm.
What does phpinfo say about PDO?
from nginx-php-fpm.
PDO
PDO support enabled
PDO drivers mysql, pgsql
pdo_mysql
PDO Driver for MySQL enabled
Client API version 10.1.17-MariaDB
Directive Local Value Master Value
pdo_mysql.default_socket /run/mysqld/mysqld.sock/ run/mysqld/mysqld.sock
from nginx-php-fpm.
What is extension_dir set to and does that have the pdo files in it?
See:
http://stackoverflow.com/questions/7126227/pdo-and-pdo-mysql-loaded-but-class-not-found
from nginx-php-fpm.
extension_dir: /usr/lib/php7/modules
I'll investigate the link and get back!
from nginx-php-fpm.
OK, so i ran
docker exec 9f46d5a887e6 /bin/sh -c "find / -name pdo.so"
and got the output:
/usr/lib/php7/modules/pdo.so
Looks like things are in their right places...?
EDIT: In the modules folder, I have:
/usr/lib/php7/modules # ls
ctype.so dom.so gd.so intl.so mcrypt.so mysqlnd.so pdo.so pdo_pgsql.so phar.so sqlite3.so xsl.so zlib.so
curl.so exif.so iconv.so json.so mysqli.so openssl.so pdo_mysql.so pgsql.so session.so xml.so zip.so
from nginx-php-fpm.
So, this might also be interesting...
When listing installed composer's installed packages running:
docker exec 9f46d5a887e6 /bin/sh -c "cd /var/www/html/; php7 /usr/bin/composer show -p"
I get the following output:
...
ext-PDO 7.0.11 The PDO PHP extension
ext-pdo_mysql 7.0.11 The pdo_mysql PHP extension
ext-pdo_pgsql 7.0.11 The pdo_pgsql PHP extension
ext-pgsql 7.0.11 The pgsql PHP extension
ext-Phar 2.0.2 The Phar PHP extension
...
Note how both Phar and PDO are listed.
from nginx-php-fpm.
That all looks OK to me, I am unsure what is going on here.
from nginx-php-fpm.
@blerko I am currently having a discussion at composer/composer. They believe that an issue could be that the php7 branch of the nginx-php-fpm image contains php5 packages. (I believe they are refering to line 39 where php5-soap is installed).
Not really sure what's going on at line 105 and 106 either - Could php5 packages cause troubles in your opinion?
from nginx-php-fpm.
The guys over at composer/composer appears to have been right. When i used the master branch (php5) instead of the php7 branch - everything worked as it should.
I would really like to use php7 however. I would suggest removing all the php5 references in the php7 branch - if you decide to do this I would gladly volunteer and test it! As for now I'll use the master branch!
A link to our discussion at composer/composer: composer/composer#5786
from nginx-php-fpm.
Yes we had a request to fix this, so I have just tried and the build failed, so I am now investigating that
from nginx-php-fpm.
By the way - and this is off topic - when pointing to the image's php7 branch in my docker-compose.yml like this:
version: '2'
services:
web:
image: richarvey/nginx-php-fpm:php7
...
...the build works. However, when cloning the repo and building it - like this:
git clone -b php7 https://github.com/ngineered/nginx-php-fpm.git
web:
build:
context: ./nginx-php-fpm
dockerfile: Dockerfile
...it fails with the error message:
//fetching stuff, lots of outprints
...
fetch http://nl.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz
ERROR: unsatisfiable constraints:
so:libcrypto.so.38 (missing):
required by:
php7-openssl-7.0.11-r1[so:libcrypto.so.38]
so:libssl.so.39 (missing):
required by:
php7-openssl-7.0.11-r1[so:libssl.so.39]
ERROR: Service 'web-dev' failed to build: The command '/bin/sh -c echo http://nl.alpinelinux.org/alpine/edge/testing >> /etc/apk/repositories && echo http://nl.alpinelinux.org/alpine/edge/community >> /etc/apk/repositories && apk update && apk add --no-cache bash openssh-client wget nginx supervisor curl git php7-fpm php7-pdo php7-pdo_mysql php7-mysqlnd php7-mysqli php7-mcrypt php7-ctype php7-zlib php7-gd php7-exif php7-intl php7-sqlite3 php7-pdo_pgsql php7-pgsql php7-xml php7-xsl php7-curl php7-openssl php7-iconv php7-json php7-phar php7-soap php7-dom php7-zip php7-session python python-dev py-pip augeas-dev openssl-dev ca-certificates dialog gcc musl-dev linux-headers libffi-dev && mkdir -p /etc/nginx && mkdir -p /var/www/app && mkdir -p /run/nginx && mkdir -p /var/log/supervisor && php7 -r "copy('https://getcomposer.org/installer', 'composer-setup.php');" && php7 -r "if (hash_file('SHA384', 'composer-setup.php') === '${composer_hash}') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;" && php7 composer-setup.php --install-dir=/usr/bin --filename=composer && php7 -r "unlink('composer-setup.php');" && pip install -U certbot && mkdir -p /etc/letsencrypt/webrootauth && apk del gcc musl-dev linux-headers libffi-dev augeas-dev python-dev' returned a non-zero code: 3
There was a problem with the php7-openssl package - could perhaps be something that also needs fixing!
from nginx-php-fpm.
Yes the php7-openssl package seems to be dependent on a couple of libraries that are available in the edge main repository. I have a working build but need to do some more investigation before I push any more changes.
from nginx-php-fpm.
I have got the build to work finally, there is some issue with docker hub and automated builds that I've just come across. Anyway I have fixed the php7-openssl build problem (I think) and expunged references to php5, let me know if that works for you.
from nginx-php-fpm.
Just a comment in your docker exec commands you dont seem to be using the -it flag which gives you an interactive terminal so you can use the cli tools.
from nginx-php-fpm.
Related Issues (20)
- Php extension not found on latest tag HOT 1
- docker-php-ext-install pdo pdo_pgsql pgsql issue Alpain: 3.14 or above
- Xdebug configuration
- ngx_devel_kit has invalid address HOT 1
- How to change max_execution_time ?
- docker build is required
- 2.2.0 Docker images HOT 2
- Update to PHP 8.2 HOT 2
- Start script fails HOT 1
- 2.2.1 and 3.0.1 images HOT 2
- Freetype not supported by gd extension HOT 5
- Mongo DB Support HOT 3
- How to add ImageMagick module HOT 1
- How install Php8.2 Mcrypt
- Nginx cannot read response from fastcgi when user id changed by environment variable
- browser after 60 seconds get 504 Gateway Time-out error
- Current PHP 8.2.7 Security Issues HOT 1
- /usr/bin/pull fails: "fatal: detected dubious ownership" HOT 1
- Q: Cron job to pull or fetch repo every 1 minute
- where do i change the value of php.ini from dockerfile? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nginx-php-fpm.