Code Monkey home page Code Monkey logo

Comments (16)

blerko avatar blerko commented on May 20, 2024

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.

victor-lund avatar victor-lund commented on May 20, 2024

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.

blerko avatar blerko commented on May 20, 2024

What does phpinfo say about PDO?

from nginx-php-fpm.

victor-lund avatar victor-lund commented on May 20, 2024

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.

blerko avatar blerko commented on May 20, 2024

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.

victor-lund avatar victor-lund commented on May 20, 2024

extension_dir: /usr/lib/php7/modules

I'll investigate the link and get back!

from nginx-php-fpm.

victor-lund avatar victor-lund commented on May 20, 2024

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.

victor-lund avatar victor-lund commented on May 20, 2024

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.

blerko avatar blerko commented on May 20, 2024

That all looks OK to me, I am unsure what is going on here.

from nginx-php-fpm.

victor-lund avatar victor-lund commented on May 20, 2024

@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.

victor-lund avatar victor-lund commented on May 20, 2024

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.

blerko avatar blerko commented on May 20, 2024

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.

victor-lund avatar victor-lund commented on May 20, 2024

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.

blerko avatar blerko commented on May 20, 2024

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.

blerko avatar blerko commented on May 20, 2024

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.

richarvey avatar richarvey commented on May 20, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.