Php fpm install pdo mysql

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

How do you get php-mysql extensions installed for php:7-fpm-alpine #279

How do you get php-mysql extensions installed for php:7-fpm-alpine #279

Comments

It seems the ‘php7-mysqli’ extension is not available?

FROM php:7-fpm-alpine RUN apk --no-cache update \ && apk --no-cache upgrade \ && apk add --no-cache php7-mysqli 
Sending build context to Docker daemon 2.048 kB Step 1 : FROM php:7-fpm-alpine ---> 50b972b9e729 Step 2 : RUN apk --no-cache update && apk --no-cache upgrade && apk add --no-cache php7-mysqli ---> Running in a04fecd6c73a fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz v3.4.2-2-gd037d87 [http://dl-cdn.alpinelinux.org/alpine/v3.4/main] v3.4.1-50-gd7c21d4 [http://dl-cdn.alpinelinux.org/alpine/v3.4/community] OK: 5967 distinct packages available fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz OK: 16 MiB in 25 packages fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz ERROR: unsatisfiable constraints: php7-mysqli (missing): required by: world[php7-mysqli] The command '/bin/sh -c apk --no-cache update && apk --no-cache upgrade && apk add --no-cache php7-mysqli' returned a non-zero code: 1 

The text was updated successfully, but these errors were encountered:

Читайте также:  Creating xml from xsd java

Источник

Saved searches

Use saved searches to filter your results more quickly

You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.

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

How do you get php-mysql extensions installed for php:7-fpm-alpine #279

How do you get php-mysql extensions installed for php:7-fpm-alpine #279

Comments

It seems the ‘php7-mysqli’ extension is not available?

FROM php:7-fpm-alpine RUN apk --no-cache update \ && apk --no-cache upgrade \ && apk add --no-cache php7-mysqli 
Sending build context to Docker daemon 2.048 kB Step 1 : FROM php:7-fpm-alpine ---> 50b972b9e729 Step 2 : RUN apk --no-cache update && apk --no-cache upgrade && apk add --no-cache php7-mysqli ---> Running in a04fecd6c73a fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz v3.4.2-2-gd037d87 [http://dl-cdn.alpinelinux.org/alpine/v3.4/main] v3.4.1-50-gd7c21d4 [http://dl-cdn.alpinelinux.org/alpine/v3.4/community] OK: 5967 distinct packages available fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz OK: 16 MiB in 25 packages fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/main/x86_64/APKINDEX.tar.gz fetch http://dl-cdn.alpinelinux.org/alpine/v3.4/community/x86_64/APKINDEX.tar.gz ERROR: unsatisfiable constraints: php7-mysqli (missing): required by: world[php7-mysqli] The command '/bin/sh -c apk --no-cache update && apk --no-cache upgrade && apk add --no-cache php7-mysqli' returned a non-zero code: 1 

The text was updated successfully, but these errors were encountered:

Источник

Php fpm install pdo mysql

This assumes you have installed the php:fpm container on Docker.

By default, the php:fpm image is configured so that only the sqllite PDO driver is enabled. For example, if you use the docker pull to pull down the latest php:fpm image.

And then use the docker run command is used to create and start the php fpm container.

docker run --detach --name php-fpm --publish 9000:9000 --restart unless-stopped php:fpm

Only the sqllite PDO driver will be enabled, which can be seen with the php -m command.

~]$ sudo docker exec php-fpm php -m | grep -i sql sqlite3

Or at your phpinfo.php page.

Let’s say you want to use the mySQL PDO driver. In this scenario, you could create a Dockerfile so that the Dockerfile contains something like this.

FROM php:fpm RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable mysqli pdo_mysql

Then use the docker build command to create the image.

docker build . --tag php:fpm_mysqli_pdo

And then use the docker run command is used to create and start the php fpm container using the image that has the mySQL PDO driver enabled.

docker run --detach --name php-fpm --publish 9000:9000 --restart unless-stopped php:fpm_mysqli_pdo

Now the mySQL PDO driver should be enabled.

Did you find this article helpful?

Buy Me A Coffee

If so, consider buying me a coffee over at

Источник

Оцените статью