我有这个问题与docker,我想在我的容器中安装soap但它永远不会工作。如果我运行此图像并尝试php -m
它将不显示肥皂。如果我运行此图像并执行此操作:
apt-get install -y libxml++2.6-dev && docker-php-ext-install soap
而且php -m
,那就行了。我真的不明白这种行为,并希望得到一些帮助!
FROM php:5.6-cli
RUN apt-get update -yqq
RUN apt-get install git -yqq
RUN apt-get install wget -yqq
RUN apt-get install libssl-dev -yqq
RUN apt-get install -yqq libfreetype6-dev libjpeg62-turbo-dev libmcrypt-dev libpng12-dev
RUN apt-get clean -yqq
RUN wget https://composer.github.io/installer.sig -O - -q | tr -d '\n' > installer.sig
RUN php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"
RUN php -r "if (hash_file('SHA384', 'composer-setup.php') === file_get_contents('installer.sig')) { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
RUN php composer-setup.php
RUN php -r "unlink('composer-setup.php'); unlink('installer.sig');"
RUN mv composer.phar /usr/bin
RUN docker-php-ext-install mysqli
RUN docker-php-ext-install zip
RUN docker-php-ext-install -j$(nproc) iconv mcrypt && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-gif-dir=/usr/include/ && docker-php-ext-install -j$(nproc) gd
RUN pecl install mongo
RUN echo "extension=mongo.so" > /usr/local/etc/php/conf.d/ext-mongo.ini
RUN pecl install mongodb
RUN echo "extension=mongodb.so" > /usr/local/etc/php/conf.d/ext-mongodb.ini
ADD ssh_key /root/.ssh/id_rsa
ADD ssh_key.pub /root/.ssh/id_rsa.pub
RUN echo " IdentityFile ~/.ssh/id_rsa" >> /etc/ssh/ssh_config
RUN echo "Host *\n\tStrictHostKeyChecking no" > /etc/ssh/ssh_config
RUN apt-get install -y libxml++2.6-dev && docker-php-ext-install soap
编辑:这是php -m
[PHP Modules]
Core
ctype
curl
date
dom
ereg
fileinfo
filter
ftp
gd
hash
iconv
json
libxml
mbstring
mcrypt
mongo
mongodb
mysqli
mysqlnd
openssl
pcre
PDO
pdo_sqlite
Phar
posix
readline
Reflection
session
SimpleXML
SPL
sqlite3
standard
tokenizer
xml
xmlreader
xmlwriter
zip
zlib
[Zend Modules]
答案 0 :(得分:2)
我已将此脚本php soap
安装到Dockerfile
RUN apt-get update && apt-get install -y libxml2-dev php-soap && docker-php-ext-install soap
答案 1 :(得分:0)
您需要安装扩展程序php5.6-xml,请参阅要求