缺少PHP 8.1 FPM Alpine上的EXIF扩展
我已经从php设置了PHP服务器:8.1.4-fpm-alpine3.14使用此Dockerfile
FROM php:8.1.4-fpm-alpine3.14
RUN apk update
RUN apk add --no-cache git libzip-dev zip unzip php8-exif
RUN docker-php-ext-install pdo pdo_mysql zip exif \
&& curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www/html
COPY . .
RUN chown -R www-data:www-data /var/www/html
RUN composer install
我尝试安装软件包spatie/laravel-Medialibrary:^10.0.0
问题1 - Spatie/laravel-Medialibrary [10.0.0,...,10.3.4]需要Ext-Exif * - >它缺少您的系统。安装或启用PHP的EXIF扩展。
如何解决这个丢失的问题?当我执行php -m
时,我在php模块列表中找不到exif
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
I have setup a php server from php:8.1.4-fpm-alpine3.14 using this dockerfile
FROM php:8.1.4-fpm-alpine3.14
RUN apk update
RUN apk add --no-cache git libzip-dev zip unzip php8-exif
RUN docker-php-ext-install pdo pdo_mysql zip exif \
&& curl -sS https://getcomposer.org/installer | php -- \
--install-dir=/usr/local/bin --filename=composer
WORKDIR /var/www/html
COPY . .
RUN chown -R www-data:www-data /var/www/html
RUN composer install
I tried installing a package spatie/laravel-medialibrary:^10.0.0
and got this error
Problem 1
- spatie/laravel-medialibrary[10.0.0, ..., 10.3.4] require ext-exif * -> it is missing from your system. Install or enable PHP's exif extension.
How do I fix this missing issue? I cannot find exif
in the php modules list when i execute php -m
[PHP Modules]
Core
ctype
curl
date
dom
fileinfo
filter
ftp
hash
iconv
json
libxml
mbstring
mysqlnd
openssl
pcre
PDO
pdo_mysql
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
sodium
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您设法解决了这个问题吗?我可以看到您正在使用
docker-php-ext-install
添加扩展名,但您没有启用它,因此如果您构建了dockerfile,则 执行此类操作(未在您的手中进行测试)再次运行
php -m
在容器中您会看到它已在此处列出。但是,当我尝试运行作曲家时,需要Spatie/Laravel-Medialibrary:^10.0.0
至少在我的情况下,我仍然会遇到相同的错误。更新
尝试使用
安装它 - 忽略plarform-reqs
param,所以这对我有用
Have you manage to resolve this? I can see you are using
docker-php-ext-install
to add the extension, but you are not enabling it, so doing something like this (not tested in your's)If you build your dockerfile and then run again
php -m
in the container you will see it is listed there. However when I tried to runcomposer require spatie/laravel-medialibrary:^10.0.0
I still get the same error, at least in my case.UPDATE
Try installing it using
--ignore-plarform-reqs
param, soThis worked for me