-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Better support/documentation for docker-php-ext-install? #75
Comments
After trawling through
Leaving this issue open because I think the wider problem is still relevant. |
I had an analogous problem when trying to install soap. I had extend my Dockerfile with apt-get install -y libxml2-dev --no-install-recommends I did not test yet whether installing one or some of ext-install options xml, xmlreader, xmlrpc, xmlwriter, or xsl would do the trick. And if so in which order? |
+1 for @MrTrick comment - finally built with LDAP now. |
I agree with the original poster that I suggest that the docker image includes a file which maps extensions to their dependencies (Debian package names) and possibly the required configure flags. The ATM the added value above the Debian provided PHP packages seems very small (unless you need a very specific version of PHP, which I don't). |
Most likely, if this route is feasibly maintainable, it should also automatically remove debian packages it installed that were only required to make the module, but not needed for runtime. Ensuring that dynamically linked libraries are kept. Then it also has to assume to do an |
(Incomplete) List of extensions and the debian packages they require to build: ldap: libldap2-dev (configure: --with-libdir=lib/x86_64-linux-gnu/) |
@yosifkit The list from @carnage contains very useful information, it should be reference from the README https://github.com/docker-library/docs/tree/master/php or added to it. Where should the place for it in the docs? |
@carnage That list should definitely become part of this repository. It's very useful and could in the future be use to automate this. Further, php-ext-install could also handle the cleanup (i.e. the cleanup section for the binary, just for extensions). |
+1 had the same problem and MrTrick's comment helped, thx |
You can get at least some hints from Examples:
|
An almost complete list:
Off topic, but another tip: If you, like me, need to run ie a framework and want to access your source directory from within your host system (lets say in your IDE for dev purposes), add this in your Dockerfile:
Of course, you will need to replace user with your local user. Maybe someone can figure out a way to make those missing extensions work. |
Yup got frustrated with this issue as well: #279 |
@hp9390 This list is great, but what about for |
Needed ldap module and @MrTrick's comment saved my day |
installing soap:
|
What about the zip extension? I need it for a project, but
I could not figure out which debian package is needed for that. |
For zip add |
Thanks, I already figured it out by using |
For ldap on alpine
|
interbase not work :/ |
May i suggest:
|
@rufinus Improvement is always welcome 👍 😄 |
@hp9390 you might want to add snmp package to the "almost complete" list. |
For reference, I suggest Laradock: https://github.com/laradock/laradock |
Not all Debian releases will use the same package name for the same dependency, support would need to be per-release not just per distro, ref: #485 , the php-gd extension requires libpng12-dev (jessie) or libpng-dev (stretch) edit: it seems libpng-dev is a virtual package in jessie, which installs libpng12-dev. This is a bad example for package name differences (as we can use libpng-dev in both?) |
@rufinus @SanderSander
I have to add
|
Fair enough! Since I asked, I've figured out that same process pretty well
so the need for such a list was greatly diminished for me personally.
Thanks for the write-up, it's a good piece of reference
…On Dec 22, 2017 3:57 PM, "Tianon Gravi" ***@***.***> wrote:
Closed #75 <#75>.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#75 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/ACA41axjMEGWFUTL9hDBGLivVKvamjUdks5tDBeegaJpZM4Dvv3D>
.
|
@tianon Perhaps add your comments into the README for the project. Point 2 is something I didn't know existed and is a much better resource than googling the specific error message thrown when something fails to compile. Happy to put in a PR later next week for it if you think it's a good idea but don't have the time. |
@carnage that's a great idea, thanks ❤️ I decided to go with a slightly longer-form explanation in https://tianon.xyz/post/2017/12/26/dockerize-compiled-software.html, which I've sent a PR to link to over in docker-library/docs#1104. 👍 |
Some extensions that weren't in the list and I had to install:
Note: this was done and tested in Debian, with the |
Those still following along here might want to check out https://github.com/mlocati/docker-php-extension-installer from @mlocati. 👍 |
FYI, for mcrypt, php 7.2
The mycrypt extension is not provided with the PHP source since 7.2. The way above is not working anymore. Updated:
|
@jungleran Thanks for the tips: I just added support for mcrypt under PHP 7.2 in my install-php-extensions mcrypt |
@mlocati Thanks very much for this script, it just saved my weekend! I needed to install 30+ extensions and it was getting incredibly tedious figuring out the dependencies and "gotchas" for each one. Your script worked perfectly 👍 |
Excuse me. I install ldap extension based
|
for ldap i use this (with 7.2)
|
@rufinus are you sure that the above script is correct? |
@mlocati - you are right this will not work: it should be:
|
Why is |
i copy/pasted it from a current project where i also needed php_intl - maybe its a left over. |
Works for me, while from daocloud.io/php:7.2-fpm-alpine, there's no apt-get ! |
@ustccq as stated above, you can use my |
great! thanks! it works on aarch64 |
I'm having trouble running
docker-php-ext-install ldap
- what are that module's dependencies?Searching for
ldap.h
in the ubuntu packages website led me to installlibldap2-dev
but there are still outstanding issues;configure: error: Cannot find ldap libraries in /usr/lib.
The meta-problem: How do users know what the dependencies are?
The php image is from a fixed platform, and there are relatively few extensions.
An automatic mechanism to grab those dependencies and provide working config defaults, or even just some documentation for each extension, would go a long way towards ease-of-use.
The text was updated successfully, but these errors were encountered: