嘿所有我试图在Docker php上安装ldap扩展:5.6-fm图像我需要ldap用于我的项目。
我已经厌倦了通过Dockerfile安装扩展程序,如下所示:
// The following using directive requires a project reference to Microsoft.VisualBasic.
using Microsoft.VisualBasic.FileIO;
class FileProgress
{
static void Main()
{
// Specify the path to a folder that you want to copy. If the folder is small,
// you won't have time to see the progress dialog box.
string sourcePath = @"C:\Windows\symbols\";
// Choose a destination for the copied files.
string destinationPath = @"C:\TestFolder";
FileSystem.CopyDirectory(sourcePath, destinationPath,
UIOption.AllDialogs);
}
}
得到此错误:
RUN apt-get install php5-ldap -y
我也找到了一些建议' online喜欢这样:
The LDAP PHP extension is not enabled.
得到此错误:
RUN \
apt-get update && \
apt-get install libldap2-dev -y && \
rm -rf /var/lib/apt/lists/* && \
docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ && \
docker-php-ext-install ldap
我做错了什么......?如何在docker镜像上安装ldap,以便我可以在我的项目中使用它??
答案 0 :(得分:1)
这是我所做的...并且正在工作。我配置了其他模块,但我认为它们不会干扰任何事情。
FROM php:5.6-apache
RUN apt-get update -y \
&& apt-get install -y libcurl4-openssl-dev pkg-config libssl-dev vim
# Configure MongoDB.
RUN pecl install mongodb \
&& docker-php-ext-enable mongodb
# Configure MySQL.
RUN docker-php-ext-install mysqli
# Configure LDAP.
RUN apt-get update \
&& apt-get install libldap2-dev -y \
&& rm -rf /var/lib/apt/lists/* \
&& docker-php-ext-configure ldap --with-libdir=lib/x86_64-linux-gnu/ \
&& docker-php-ext-install ldap
RUN a2enmod rewrite && service apache2 restart
# Python 2.7 and modules
RUN apt install python2.7 python-pip -y \
&& python2.7 -m pip install pymysql pymongo redis
# We must reconfigure here the CMD directive.
CMD apache2-foreground