New issue
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
Closed
k0pernikus opened this issue
Oct 19, 2016
· 10 comments
Comments
I have the dockerfile:
FROM php:7-apache
RUN docker-php-ext-install soap
COPY ./ /var/www/html
and it tries to install the soap extension, yet fails at one point:
checking whether to enable SOAP support... yes, shared
checking libxml2 install dir... no
checking for xml2-config path...
configure: error: xml2-config not found. Please check your libxml2 installation.
Shouldn’t this work out of the box or is it expected that I have to manually install that libxml2 library?
When manually installing libxml, the container builds at least:
RUN apt-get -qq update && apt-get -qq install libxml++2.6-dev > /dev/null
That is the current expected behavior. We try to keep the image at least a little smaller by not including all the libraries that might be required by the different plugins.
@yosifkit Thanks for pointing it out. From a user perspective, I expected it «to just work».
One ought to make docker-php-ext-install
smarter by either installing those libraries on the fly or rendering a better error message.
@k0pernikus where you able to use a soap client after installing it? I still get Class 'SoapClient' not found
even after the libxml2 is installed.
found the answer. was missing php-soap
RUN apt-get update -y
&& apt-get install -y
libxml2-dev
php-soap
&& apt-get clean -y
&& docker-php-ext-install soap
https://rapiddg.com/blog/setting-php-soap-docker
patrikjuvonen reacted with laugh emoji
alexsandro-xpt, kristiyanP, Miorey, danitome24, aonurdemir, josef-rybicka-zz, fernandovbs, and saraidev reacted with hooray emoji
renandelmonico, danitome24, aonurdemir, JulienBreux, and milrak reacted with heart emoji
baghayi reacted with rocket emoji
aleksandrgilarov reacted with eyes emoji
@waspinator I’m also installing libxml2-xml
rather than libxml++2.6-dev
and can confirm that it works without installing php-soap
. Here’s an example that might help you get started.
index.php
<html> <h1>Docker SOAP Example</h1> Is soap installed? <?php echo class_exists('SoapClient') ? "Yes" : "No"; ?> <h2>Working Example</h2> <?php $sillyNumber = is_numeric($_GET['degrees']) ? $_GET['degrees'] : 0; ?> How much is <?php echo $sillyNumber ?> °F in °C? <?php // convert number using example service from http://www.webservicex.net/WS/WSDetails.aspx?WSID=31&CATID=13 $client = new SoapClient('http://www.webservicex.net/ConvertTemperature.asmx?WSDL'); $args = [ 'Temperature' => $sillyNumber, 'FromUnit' => 'degreeFahrenheit', 'ToUnit' => 'degreeCelsius' ]; echo $client->ConvertTemp($args)->ConvertTempResult; ?> °C <small>Add ?degrees=<double> to change the requested value</small>
Dockerfile
FROM php:7-apache
RUN apt-get update &&
apt-get install -y libxml2-dev &&
docker-php-ext-install soap
COPY index.php /var/www/html
Installing the php-soap
package will pull in debian’s packaged php in parallel to the source build from this image. If you use a debian module with the images php release, it will most likely not work due to versions mismatches between the two.
bor8 and maraism reacted with laugh emoji
bor8 and danielaugustospo reacted with hooray emoji
bor8 and milrak reacted with heart emoji
bor8 reacted with rocket emoji
aleksandrgilarov reacted with eyes emoji
See #75 for more discussion on the topic of «installing dependencies by default».
Given that this is working as designed and #75 is still open for the topic of installing dependencies by default, I’m going to close this one. 👍
It makes sense that docker-php-ext-install
should install dependencies as well as the Php extension, since Docker users are more developers than administrators.
(I understand this means lot of work for that feature).
To address the SOAP install issue in a php:7.1-fpm image and the more recent php-soap has no installation candidate
issue, I was worried about removing the no-debian-php
directives that would install pieces of PHP-5.4.
I found a work-around by installing SOAP with PEAR.
A minimal Dockerfile would look like :
FROM php:7.1-fpm
RUN apt-get update && apt-get install -y libxml2-dev
&& pear install -a SOAP-0.13.0
&& docker-php-ext-install soap;
I’m posting here because I’m not entirely sure this is a good idea. But if it is, I hope it helps !
vincentpazeller, danitome24, honzarac, monsefoster, MitchellMcKenna, bertrandjamin, datpmwork, and milrak reacted with heart emoji
joschi127
added a commit
to joschi127/docker-php-plus-nvm
that referenced
this issue
Aug 13, 2018
Many thanks @Manumie your instructions worked for me too.
@k0pernikus where you able to use a soap client after installing it? I still get
Class 'SoapClient' not found
even after the libxml2 is installed.found the answer. was missing
php-soap
RUN apt-get update -y && apt-get install -y libxml2-dev php-soap && apt-get clean -y && docker-php-ext-install soap
https://rapiddg.com/blog/setting-php-soap-docker
You dont need to add «php-soap», you should add only in the command «docker-php-ext-install soap»
В данной теме я расскажу с какими ошибками при компиляции PHP на CentOS x64 можно столкнуться. Так же приведу готовые решения как решить ту или иную проблему.
configure: error: xml2-config not found. Please check your libxml2 installation.
# yum install libxml2-devel.x86_64 |
configure: error: Cannot find OpenSSL’s
# yum install openssl-devel.x86_64 |
configure: error: Could not find pcre.h in /usr/local
# yum install pcre-devel.x86_64 |
configure: error: Could not find pcre.h in /usr/local
«—with-pcre-regex=/usr/include»
configure: error: Could not find libpcre.(a|so) in /usr/include
«—with-pcre-regex=/usr»
configure: error: Please reinstall the libcurl distribution -easy.h should be in /include/curl/
# yum install libcurl-devel.x86_64 |
configure: error: libjpeg.(a|so) not found.
# yum install libjpeg-devel.x86_64 |
configure: error: libpng.(a|so) not found.
# yum install libpng-devel.x86_64 |
configure: error: freetype.h not found.
# yum install freetype-devel.x86_64 |
configure: error: Please reinstall the iconv library.
«—with-iconv»
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
# yum install libmcrypt.x86_64 libmcrypt-devel.x86_64 |
configure: error: Please reinstall libmhash – I cannot find mhash.h
# yum install mhash.x86_64 mhash-devel.x86_64 |
Note that the MySQL client library is not bundled anymore!
# yum install php-mysql.x86_64 mysql-devel.x86_64 |
configure: error: Please reinstall the BZip2 distribution
# yum install bzip2-devel.x86_64 |
configure: error: utf8_mime2text() has new signature, but U8T_CANONICAL is missing. This should not happen. Check config.log for additional information.
DISABLE IMAP
configure: error: Cannot find pspell
# yum install aspell-devel.x86_64 |
configure: error: Cannot find libtidy
# yum install libtidy.x86_64 libtidy-devel.x86_64 |
error: xslt-config not found. Please reinstall the libxslt >= 1.1.0 distribution
# yum install libxslt.x86_64 libxslt-devel.x86_64 |
collect2: ld returned 1 exit status
# yum install glibc-utils.x86_64 libtool-ltdl-devel.x86_64 |
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
скачать libmcrypt—2.5.8.tar.gz # cd /usr/local/src # tar zxvf libmcrypt-2.5.8.tar.gz && cd libmcrypt-2.5.8 # ./configure && make && make install # ln -s /usr/local/lib/libmcrypt.so.4 /lib64/libmcrypt.so.4 |
With these build options a libphp5.so is not created and so Apache cannot use PHP.
On my CentOS 5.8 build I had to add the following configuration line to get that file created.
./configure –with-apxs2=/usr/sbin/apxs
configure: error: snmp.h not found. Check your SNMP installation.
# yum install net-snmp-devel |
checking for curl_multi_strerror in -lcurl… yes
checking for QDBM support… no
checking for GDBM support… no
checking for NDBM support… no
configure: error: DBA: Could not find necessary header file(s).
Fix:
Для тех кто хочет быстро исправить все проблемы, попробуйте запустить так:
# yum install glibc-utils.x86_64 libtool-ltdl-devel.x86_64 libxslt.x86_64 libxslt-devel.x86_64 libtidy.x86_64 libtidy-devel.x86_64 aspell-devel.x86_64 bzip2-devel.x86_64 php-mysql.x86_64 mysql-devel.x86_64 mhash.x86_64 mhash-devel.x86_64 libmcrypt.x86_64 libmcrypt-devel.x86_64 freetype-devel.x86_64 libpng-devel.x86_64 libjpeg-devel.x86_64 curl-devel.x86_64 openssl-devel.x86_64 libxml2-devel.x86_64 net-snmp-devel libcurl-devel.x86_64 |
Обновление и установка средств разработки и библиотек
# yum update # yum group install «Development Tools» # yum group install «Development Libraries» |
После чего запустите bash скрипт:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
#!/bin/sh «./configure» «—prefix=/usr/local/php5» «—enable-force-cgi-redirect» «—enable-fastcgi» «—with-bz2» «—with-config-file-path=/usr/local/etc» «—with-config-file-scan-dir=/usr/local/etc/php.d» «—with-curl=/usr/local/lib» «—with-gd» «—with-gettext» «—with-jpeg-dir=/usr/local/lib» «—with-freetype-dir=/usr/local/lib» «—with-kerberos» «—with-mcrypt» «—with-mhash» «—with-mime-magic» «—with-mysql» «—with-mysqli» «—with-pcre-regex=/usr» «—with-pdo-mysql=shared» «—with-pdo-sqlite=shared» «—with-pear=/usr/local/lib/php» «—with-png-dir=/usr/local/lib» «—with-pspell» «—with-sqlite=shared» «—with-tidy» «—with-ttf» «—with-xmlrpc» «—with-xsl» «—with-zlib» «—with-zlib-dir=/usr/local/lib» «—with-openssl» «—with-iconv» «—with-libdir=lib64» «—enable-bcmath» «—enable-calendar» «—enable-exif» «—enable-ftp» «—enable-gd-native-ttf» «—enable-libxml» «—enable-magic-quotes» «—enable-soap» «—enable-sockets» «—enable-mbstring» «—enable-zip» «—enable-wddx» |
https://github.com/midnight47/
Когда я пытаюсь установить php 5.3 stable из источника на Ubuntu (загрузка сжатого установочного файла с http://www.php.net/downloads.php ), и я запускаю ./configure
Я получаю эту ошибку:
configure: error: xml2-config not found. Please check your libxml2 installation.
- Как получить доступ к свойству / значению массива, который был преобразован в объект?
- PHP-композитор за HTTP-прокси
- Даты обработки проблем в доктрине php
- PHP неправильно обрабатывает мой статический вызов
- curl posting с приложением заголовка / x-www-form-urlencoded
- Как разбирать пространства имен xml с DOMDocument и обязательно получать объекты
Solutions Collecting From Web of «Как исправить ошибку с xml2-config не найден при установке PHP из источников?»
- автозагрузка и пространства имен
- array_diff в массиве ассоциативных массивов в php
- Экспорт pdf-документа с использованием php с помощью dompdf
- Как определить, загрузил ли пользователь файл больше, чем post_max_size?
- Многомерный массив для массива
- Неинтерминированная ошибка ссылки на объект в PHP 5.3.X
- Предупреждение: preg_match () : Неизвестный модификатор ‘-‘
- Искать только списки каталогов?
Все, что вам нужно сделать, установить пакет установки libxml2-dev, например:
sudo apt-get install libxml2-dev
На CentOS / RHEL:
sudo yum install libxml2-devel
Для последних версий необходимо установить libxml ++ 2.6-dev так:
apt-get install libxml++2.6-dev
On Centos 6.3 while installing PHP 5.4 I ran into the subject error.
This fixed it:
# yum install libxml2-devel
note: on other OS you should try to apt-get install libxml2-dev
Here is the configure command I’m trying to do:
'./configure'
'--with-apxs2=/usr/local/apache2/bin/apxs'
'--with-mysql'
'--libdir=/usr/lib64'
'--with-libdir=lib64'
'--with-zlib'
'--with-gettext'
'--with-gdbm'
'--with-gd'
'--with-jpeg-dir=/usr'
'--with-freetype-dir=/usr'
'--with-mcrypt'
'--with-openssl'
"$@"
Next error: configure: error: DBA: Could not find necessary header file(s).
fixed it with:
# yum install gdbm-devel
Next: configure: error: jpeglib.h not found.
# yum install libjpeg-devel.x86_64
(that was a hard one to find!)
configure: error: freetype.h not found.
# yum install freetype-devel
configure: error: mcrypt.h not found. Please reinstall libmcrypt.
There does not seem to be any good / easy solution to this on CentOS 6.3.
UPDATE: This guy has the solution
rpm -ivh http://download.fedoraproject.org/pub/epel/6/x86_64/epel-release-6-7.noarch.rpm
yum update
yum install libmcrypt-devel
yum install mcrypt-devel
yum install php-mcrypt
Configure worked!
it works now, yay
This entry was posted in Uncategorized. Bookmark the permalink.
Нотатки сісадміна Linux,php PHP configure: error: xml2-config not found. Please check your libxml2 installation.
20 Січня 201520 Січня 2015
| graffgraff
| 0 коментарів
| 15:32
Categories:
- Linux
- php
Ставлю на сервак вторую версию php55 как cgi, ставлю из иcходников, вылазит это:
“PHP configure: error: xml2-config not found. Please check your libxml2 installation.”
решается просто:
для Centos
1 |
yum install libxml2—devel |
для Debian:
1 |
apt—get install libxml2—dev |
После этого спокойно продолжаем
1 голос
Схожі записи:
ERROR: /bin/sh: 1: xslt-config: not found
PHP Fatal error: Class ‘Memcache’ not found in
configure: error: Cannot find OpenSSL’s libraries
Две версии php на одном сервере Centos или Debian
Позначки:php55-cgi
Leave a Reply
Увійти через:
Ваша e-mail адреса не оприлюднюватиметься. Обов’язкові поля позначені *
Коментар *
Ім’я *
Email *
Сайт
Related Post
How to fix “ERROR 130 (HY000): Incorrect file format”How to fix “ERROR 130 (HY000): Incorrect file format”
Начал перенос сайта на новый сервер, при создании дампа наткнулся на ошибку “How to fix “ERROR 130 (HY000): Incorrect file format”” 3 голоса Схожі записи: Fatal error: Python.h: No such
Читати даліЧитати далі
centos dig yum installcentos dig yum install
Давно не сталкивался со старичком Centos – а тут надо было клиенту “пошаманить” – кинулся проверить работу DNS через dig – а его нет 1 голос Схожі записи: Подключение EPEL
Читати даліЧитати далі
speedtest-cli или проверяем канал сервера в обе стороны.speedtest-cli или проверяем канал сервера в обе стороны.
Сегодня столкнулся в очередной раз как можно проверить канал на выделенном сервере, не всегда есть под рукой пустующий сервак с каналом на 1Гбс. Погуглил – решение оказалось до безумия простое.
Читати даліЧитати далі