Beim Versuch, PHP 5.6.30 mit Apache 2.4 zu verwenden, scheint es ein etwas bekanntes Problem zu geben (außerhalb der Verwendung von Docker) aber es scheint keine wirkliche Lösung für die Behebung des Problems zu geben. Ich erhalte die folgende Fehlermeldung:Kann c: /php/php5apache2_4.dll nicht in Server laden: Das angegebene Modul konnte nicht gefunden werden
httpd.exe: Syntax error on line 534 of C:/Apache24/conf/httpd.conf: Cannot load c:/php/php5apache2_4.dll into server: The specified module could not be found.
das Verzeichnis C Prüfungs: \ php (im Docker-Container) Ich sehe die DLL klar gibt es
03/09/2017 04:34 PM <DIR> .
03/09/2017 04:34 PM <DIR> ..
01/18/2017 08:12 PM 69,632 deplister.exe
03/09/2017 04:34 PM <DIR> dev
03/09/2017 04:34 PM <DIR> ext
03/09/2017 04:34 PM <DIR> extras
01/18/2017 08:12 PM 1,290,752 glib-2.dll
01/18/2017 08:12 PM 16,384 gmodule-2.dll
01/18/2017 08:12 PM 25,672,192 icudt57.dll
01/18/2017 08:12 PM 2,065,920 icuin57.dll
01/18/2017 08:12 PM 51,200 icuio57.dll
01/18/2017 08:12 PM 257,536 icule57.dll
01/18/2017 08:12 PM 50,176 iculx57.dll
01/18/2017 08:12 PM 63,488 icutest57.dll
01/18/2017 08:12 PM 196,096 icutu57.dll
01/18/2017 08:12 PM 1,456,128 icuuc57.dll
01/18/2017 08:12 PM 79,408 install.txt
03/09/2017 04:34 PM <DIR> lib
01/18/2017 08:12 PM 2,244,096 libeay32.dll
01/18/2017 08:12 PM 46,592 libenchant.dll
01/18/2017 08:12 PM 185,344 libpq.dll
01/18/2017 08:12 PM 237,056 libsasl.dll
01/18/2017 08:12 PM 213,504 libssh2.dll
01/18/2017 08:12 PM 3,286 license.txt
01/18/2017 08:12 PM 557,659 news.txt
01/18/2017 08:12 PM 43 phar.phar.bat
01/18/2017 08:12 PM 53,242 pharcommand.phar
01/18/2017 08:12 PM 59,392 php-cgi.exe
01/18/2017 08:12 PM 32,256 php-win.exe
01/18/2017 08:12 PM 79,872 php.exe
01/18/2017 08:12 PM 2,523 php.gif
01/18/2017 08:12 PM 75,684 php.ini-development
01/18/2017 08:12 PM 75,715 php.ini-production
01/18/2017 08:12 PM 32,768 php5apache2_4.dll <--- look right here
01/18/2017 08:12 PM 846,630 php5embed.lib
01/18/2017 08:12 PM 168,960 php5phpdbg.dll
01/18/2017 08:12 PM 8,343,040 php5ts.dll
01/18/2017 08:12 PM 181,760 phpdbg.exe
01/18/2017 08:12 PM 21,360 readme-redist-bins.txt
01/18/2017 08:12 PM 3,634 snapshot.txt
01/18/2017 08:12 PM 353,792 ssleay32.dll
35 File(s) 45,087,120 bytes
This answer Gespräche darum, sicherzustellen, verwenden die gleiche Bit-Version (ich benutze 64 Bit) und auch um sicherzustellen, dass die Versionen threadsicher sind, was sie sind. Hier in meinem Dockerfile, können Sie die Links zu den 64-Bit-Thread-sichere Versionen von Apache und PHP sehen:
FROM microsoft/windowsservercore
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest -Method Get -Uri https://www.apachelounge.com/download/VC11/binaries/httpd-2.4.25-win64-VC11.zip -OutFile c:\apache.zip ; \
Expand-Archive -Path c:\apache.zip -DestinationPath c:\ ; \
Remove-Item c:\apache.zip -Force
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest -Method Get -Uri "http://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x64.exe" -OutFile c:\vcredist_x64.exe ; \
start-Process c:\vcredist_x64.exe -ArgumentList '/quiet' -Wait ; \
Remove-Item c:\vcredist_x64.exe -Force
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \
Invoke-WebRequest -Method Get -Uri http://windows.php.net/downloads/releases/php-5.6.30-Win32-VC11-x64.zip -OutFile c:\php.zip ; \
Expand-Archive -Path c:\php.zip -DestinationPath c:\php ; \
Remove-Item c:\php.zip -Force
RUN powershell -Command \
$ErrorActionPreference = 'Stop'; \
Remove-Item c:\Apache24\conf\httpd.conf ; \
new-item -Type Directory c:\www -Force ; \
Add-Content -Value "'<?php phpinfo() ?>'" -Path c:\www\index.php
ADD httpd.conf /apache24/conf
WORKDIR /Apache24/bin
CMD /Apache24/bin/httpd.exe -w
Beachten Sie die Visual Studio-Compiler ist für das Jahr 2015 Muss ich wirklich das Spielfeld Ebene für den Compiler verwenden?
Schließlich werden die folgenden Zeilen in der httpd.conf (Linie 534, die in der Fehler erwähnt, ist die Leitung mit LoadModule
beginnend) sind, was den Fehler verursacht in den Docker logs für den Behälter zu zeigen, wenn gestartet. Ich habe sie zur Zeit kommentiert, so konnte ich Apache als Stand-alone zu starten (das Erlauben mir, zu untersuchen, was im Innern des Behälters los ist).
# configure the path to php.ini
# PHPIniDir "C:/php"
# LoadModule php5_module "c:/php/php5apache2_4.dll"
# AddHandler application/x-httpd-php .php
Ich plane einige bestehende PHP-Code in den Behälter einzusetzen und wollen nicht PHP7 aktualisieren (was mehr Arbeit zu schaffen, einige Dinge mit Code zu beheben, die auf PHP7 fehl). Gibt es außer dem Upgrade auf PHP 7 noch eine andere Möglichkeit, das Problem zu beheben?
Sie sollten zuerst und wickeln die beiden anderen Konfigurationen in einer 'IfModule' setzen' LoadModule', da es die notwendigen 'PHPIniDir' Richtlinie lädt:
Sie sollten auch Ihre Konfiguration als solche eingerichtet. –
ich, dass @DissidentRage tun würde, aber es wird immer noch auf der 'LoadModule' scheitern –
Ich weiß, das ist, warum ich es nicht als eine Antwort hinterlassen habe. Haben Sie das verteilbare VC 2014 installiert? –