yiisoft / yii2-docker

Official Docker images suitable for Yii 2.0
https://www.yiiframework.com/
BSD 3-Clause "New" or "Revised" License
381 stars 202 forks source link

Not all extensions are visible in phpinfo #165

Closed wertex closed 1 year ago

wertex commented 1 year ago

Hello! I decided to try your version of docker image. Faced this problem: in phpinfo() does not give information that some modules are installed: PDO MySQL, Soap, GD. Tell me, please, why is this happening?

schmunk42 commented 1 year ago

Which image are you using?

> docker run --rm yiisoftware/yii2-php:8.0-fpm php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => sqlite, mysql, pgsql
PDO Driver for MySQL => enabled
PDO Driver for PostgreSQL => enabled
PDO Driver for SQLite 3.x => enabled

Minimal images do not have (all) PDO installed

> docker run --rm yiisoftware/yii2-php:8.0-fpm-min php -i | grep PDO
PDO
PDO support => enabled
PDO drivers => sqlite
PDO Driver for SQLite 3.x => enabled
wertex commented 1 year ago

I plan to use the image from 8.1, but neither in it nor in 7.4 does phpinfo() show the presence of connected modules. It turns out they need to be included separately after building?

schmunk42 commented 1 year ago

Please show your docker or docker-compose config to reproduce. Along with a screenshot or console output like above.

wertex commented 1 year ago

What I did: git clone https://github.com/yiisoft/yii2-docker.git Next I change the files: .env PHP_BASE_IMAGE_VERSION=8.1-apache because i have version 2.45 I didn't make any other changes If you put index.php in the /app/web folder and specify phpinfo() in it, then all the components that are listed here are not indicated there https://github.com/yiisoft/yii2-docker/blob/731669c4ac2db04d73f19a6927f08c601c593908/php/Dockerfile-debian#L51

wertex commented 1 year ago

1 2 PHP 8.1.20 - phpinfo().pdf

schmunk42 commented 1 year ago

Please make sure you are connecting to the correct container.

Dev/Normal images have PDO extensions installed, shown below via browser and console.

Bildschirmfoto vom 2023-06-13 16-26-30


> docker-compose ps                                     
        Name                      Command               State                  Ports                
----------------------------------------------------------------------------------------------------
yii2apache_php-dev_1   docker-php-entrypoint apac ...   Up      0.0.0.0:8102->80/tcp,:::8102->80/tcp
yii2apache_php-min_1   docker-php-entrypoint apac ...   Up      0.0.0.0:8101->80/tcp,:::8101->80/tcp

> docker exec yii2apache_php-dev_1 php -i | grep PDO    
PDO
PDO support => enabled
PDO drivers => sqlite, mysql, pgsql
PDO Driver for MySQL => enabled
PDO Driver for PostgreSQL => enabled
PDO Driver for SQLite 3.x => enabled

> docker exec yii2apache_php-dev_1 php -v           
PHP 8.1.20 (cli) (built: Jun 13 2023 11:48:15) (NTS)
Copyright (c) The PHP Group
Zend Engine v4.1.20, Copyright (c) Zend Technologies
    with Zend OPcache v8.1.20, Copyright (c), by Zend Technologies