I have this issue with docker, I want to install soap in my container but it never works. If I run this image and try to php -m
it will not show soap. If I run this image and do this:
apt-get install -y libxml++2.6-dev && docker-php-ext-install soap
And php -m
, then it works. I really don't understand this behavior and would love some help!
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
Edit: here is the output of 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]
我已经使用此脚本将php soap
安装到Dockerfile
RUN apt-get update && apt-get install -y libxml2-dev php-soap && docker-php-ext-install soap
You need to install an extension php5.6-xml, see requirements
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.