Ich versuche, eine grundlegende PHP-Seite mit HTML-Erweiterung bei Cloud Foundry, genauer unter Swisscom Application Cloud bereitzustellen.Cloud Foundry PHP Website-Instanz stürzt mit benutzerdefinierten Mime-Konfiguration
Das ist meine einzige Quelldatei, befindet sich auf ${APP_ROOT}/www/index.html
<html>
<?php
phpinfo();
?>
</html>
Meine Konfigurationsdateien sind wie folgt.
Bei .bp-config/options.json
:
{
"WEBDIR": "www",
"PHP_VERSION": "{PHP_56_LATEST}",
"WEB_SERVER": "httpd"
}
Bei .bp-config/httpd/httpd.conf
:
ServerRoot "${HOME}/httpd"
Listen ${PORT}
ServerAdmin "${HTTPD_SERVER_ADMIN}"
ServerName sample-app.scapp.io
DocumentRoot "${HOME}/#{WEBDIR}"
Include conf/extra/httpd-modules.conf
Include conf/extra/httpd-mime.conf
Der Servername ich aus dem Setup in der Swisscom App Cloud nehme:
Bei .bp-config/httpd/extra/httpd-modules.conf
:
LoadModule mpm_event_module modules/mod_mpm_event.so
Dies scheint gemäß Fehlerprotokollen erforderlich zu sein, falls nicht enthalten.
Bei .bp-config/httpd/extra/httpd-mime.conf
:
<IfModule mime_module>
AddType application/x-httpd-php .php .htm .html
</IfModule>
Der Quellcode oben kann der Einfachheit halber bei this GitHub repo zugegriffen werden.
Die Instanz kann nicht gestartet werden, aber ich kann keine beschreibende Fehlermeldung finden. Dies sind die Protokolle von der Swisscom Anwendung Cloud:
2017-05-19 12:56:26 [API/1] OUT Created app with guid 383e1568-29e9-4ef5-9825-3e1248a85b8e
2017-05-19 12:56:28 [API/3] OUT Updated app with guid 383e1568-29e9-4ef5-9825-3e1248a85b8e ({"route"=>"025e8337-7fd2-42c8-a325-d535af3db460", :verb=>"add", :relation=>"routes", :related_guid=>"025e8337-7fd2-42c8-a325-d535af3db460"})
2017-05-19 12:56:38 [API/1] OUT Updated app with guid 383e1568-29e9-4ef5-9825-3e1248a85b8e ({"state"=>"STARTED"})
2017-05-19 12:56:38 [STG/0] OUT Downloading dotnet_core_buildpack...
2017-05-19 12:56:38 [STG/0] OUT Downloading nodejs_buildpack...
2017-05-19 12:56:38 [STG/0] OUT Downloading python_buildpack...
2017-05-19 12:56:38 [STG/0] OUT Downloading binary_buildpack...
2017-05-19 12:56:38 [STG/0] OUT Downloading go_buildpack...
2017-05-19 12:56:39 [STG/0] OUT Downloaded nodejs_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloading php_buildpack...
2017-05-19 12:56:39 [STG/0] OUT Downloaded dotnet_core_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloading java_buildpack...
2017-05-19 12:56:39 [STG/0] OUT Downloaded binary_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloading staticfile_buildpack...
2017-05-19 12:56:39 [STG/0] OUT Downloaded python_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloading ruby_buildpack...
2017-05-19 12:56:39 [STG/0] OUT Downloaded go_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloaded java_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloaded php_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloaded staticfile_buildpack
2017-05-19 12:56:39 [STG/0] OUT Downloaded ruby_buildpack
2017-05-19 12:56:39 [STG/0] OUT Creating container
2017-05-19 12:56:39 [STG/0] OUT Successfully created container
2017-05-19 12:56:39 [STG/0] OUT Downloading app package...
2017-05-19 12:56:39 [STG/0] OUT Downloaded app package (1.5K)
2017-05-19 12:56:39 [STG/0] OUT Staging...
2017-05-19 12:56:41 [STG/0] OUT -------> Buildpack version 4.3.31
2017-05-19 12:56:41 [STG/0] OUT Installing HTTPD
2017-05-19 12:56:41 [STG/0] OUT HTTPD 2.4.25
2017-05-19 12:56:42 [STG/0] OUT Downloaded [file:///tmp/buildpacks/d16e91f150d8c31f69507a615bf75f08/dependencies/https___buildpacks.cloudfoundry.org_dependencies_httpd_httpd-2.4.25-linux-x64-bf8851c4.tgz] to [/tmp]
2017-05-19 12:56:42 [STG/0] OUT Installing PHP
2017-05-19 12:56:42 [STG/0] OUT PHP 5.6.30
2017-05-19 12:56:42 [STG/0] OUT Downloaded [file:///tmp/buildpacks/d16e91f150d8c31f69507a615bf75f08/dependencies/https___buildpacks.cloudfoundry.org_dependencies_php_php-5.6.30-linux-x64-13625eaa.tgz] to [/tmp]
2017-05-19 12:56:44 [STG/0] OUT Finished: [2017-05-19 10:56:44.679464]
2017-05-19 12:56:53 [STG/0] OUT Exit status 0
2017-05-19 12:56:53 [STG/0] OUT Staging complete
2017-05-19 12:56:53 [STG/0] OUT Uploading droplet, build artifacts cache...
2017-05-19 12:56:53 [STG/0] OUT Uploading droplet...
2017-05-19 12:56:53 [STG/0] OUT Uploading build artifacts cache...
2017-05-19 12:56:53 [STG/0] OUT Uploaded build artifacts cache (198B)
2017-05-19 12:57:01 [STG/0] OUT Uploaded droplet (55.3M)
2017-05-19 12:57:01 [STG/0] OUT Uploading complete
2017-05-19 12:57:01 [STG/0] OUT Destroying container
2017-05-19 12:57:02 [CELL/0] OUT Creating container
2017-05-19 12:57:02 [CELL/0] OUT Successfully created container
2017-05-19 12:57:04 [STG/0] OUT Successfully destroyed container
2017-05-19 12:57:06 [CELL/0] OUT Starting health monitoring of container
2017-05-19 12:57:07 [APP/PROC/WEB/0] OUT 10:57:07 php-fpm | [19-May-2017 10:57:07] NOTICE: fpm is running, pid 40
2017-05-19 12:57:07 [APP/PROC/WEB/0] OUT 10:57:07 php-fpm | [19-May-2017 10:57:07] NOTICE: ready to handle connections
2017-05-19 12:57:07 [APP/PROC/WEB/0] OUT Exit status 1
2017-05-19 12:57:07 [CELL/0] OUT Exit status 0
2017-05-19 12:57:07 [CELL/0] OUT Destroying container
2017-05-19 12:57:07 [API/3] OUT Process has crashed with type: "web"
2017-05-19 12:57:07 [API/3] OUT App instance exited with guid 383e1568-29e9-4ef5-9825-3e1248a85b8e payload: {"instance"=>"", "index"=>0, "reason"=>"CRASHED", "exit_description"=>"2 error(s) occurred:\n\n* 2 error(s) occurred:\n\n* Exited with status 1\n* cancelled\n* cancelled", "crash_count"=>1, "crash_timestamp"=>1495191427514377386, "version"=>"ede7276b-e0a6-467c-a86a-5c60f1c36021"}
Ich denke, es muss andere Protokolle mit weiteren Informationen über den Absturz, aber ich weiß nicht, wo sie zu finden.
Was verursacht den Absturz und wie kann ich es beheben?
Ich habe die [ganze Standard-Konfiguration] (https://github.com/cloudfoundry/php-buildpack/tree/master/defaults/config) kopiert und das Problem mit dem Absturz gelöst, aber ich kann immer noch nicht Ihre Konfiguration anwenden erfolgreich: 'Fehler erhalten 'Zugriff auf das Skript' /home/vcap/app/www/index.html 'wurde verweigert (siehe security.limit_extensions)'. Die letzten Änderungen sind [hier] (https://github.com/atineoSE/sample-php-app-cloudfoundry). – atineoSE
Für die Aufzeichnung ist die php build pack-Version 4.3.31, daher verwende ich den Ansatz, um die gesamte 'php-fpm.conf'-Datei zu kopieren. – atineoSE
Sie müssen' security.limit_extensions' wie im obigen Beispiel einstellen. In der Standard-Datei ist sie auskommentiert, entfernen Sie das Kommentarzeichen und setzen Sie die Liste auf '.php .html'. Für das, was es wert ist, fügen Sie keine Konfigurationsdateien mit Ihrer App ein, die Sie nicht überschreiben. Dadurch kann das Build Pack die Standardwerte bereitstellen. Ich sehe, du hast auch 'php.ini' dort. Sie möchten nur die eine Datei überschreiben, die Sie überschreiben. –