paketo-buildpacks / php-builtin-server

PHP Builtin Web Server Buildpack
Apache License 2.0
0 stars 2 forks source link

libxml2 not installed #173

Open sylvainkalache opened 1 year ago

sylvainkalache commented 1 year ago

The Buildpack is not installing libxml2 which is needed for PHP to run.

Expected Behavior

Shall not the PHP Buildpack install libxml2 natively? I am new to using Buildpack so I may be missing something :)

Current Behavior

$ cf push php-builtin
Pushing app php-builtin to org tutorial-org / space tutorial-space as cf-admin...
Packaging files to upload...
Uploading files...
 1.57 KiB / 1.57 KiB [=========================================================================================================================] 100.00% 1s

Waiting for API to complete processing files...

Staging app and tracing logs...
BuildFailed: Check build log output
FAILED
$ cf logs php-builtin --recent
Retrieving logs for app php-builtin in org tutorial-org / space tutorial-space as cf-admin...

   1970-01-01T00:00:00.00+0000 [STG/] OUT
   2023-07-31T18:40:37.39+0000 [APP/] OUT php: error while loading shared libraries: libxml2.so.2: cannot open shared object file: No such file or directory

Steps to Reproduce

git clone https://github.com/paketo-buildpacks/samples/tree/main/php/builtin-server
cf push php-builtin
cf logs php-builtin --recent

Motivations

I am trying to push a PHP app using CloudFoundry Korifi.

arjun024 commented 1 year ago

I'm not familiar with CF Korifi, but your platform may not be using the right stack.

libxml2 package is mandated by the php-dist component buildpack, which is provided by the Paketo Jammy Full Stack. You cannot use other stacks (tiny, base, static etc.) since the only the full stack fulfills this requirement.

See Full stack Bill of Materials - https://github.com/paketo-buildpacks/jammy-full-stack/releases/download/v0.0.118/jammy-full-stack-0.0.118-build-receipt.cyclonedx.json

Please feel free to reopen the issue for further discussions

robdimsdale commented 1 year ago

Just to add to this, I think there's some confusion here - you're pushing the Paketo samples to Cloud Foundry. The Paketo samples are intended for the Paketo buildpacks. For Cloud Foundry Php support you could take a look at the CF Php buildpack.

ramiyengar commented 1 year ago

@robdimsdale , What Sylvain is referring to here is Cloud Foundry Korifi which internally uses kpack, which uses Paketo Buildpacks for builds. I tried using the pack command to build this app and got a couple of errors. Pasting below for reference.

$ pwd
~/samples/php/builtin-server
$ pack build php-builtin-server-sample
...
ERROR: No buildpack groups passed detection.
ERROR: Please check that you are running against the correct path.
ERROR: failed to detect: no buildpacks participating
ERROR: failed to build: executing lifecycle: failed with status code: 20
$ pack build php-builtin-server-sample --buildpack paketo-buildpacks/php
... 
ERROR: failed to build: validating stack mixins: buildpack paketo-buildpacks/php-dist@2.1.8 requires missing mixin(s): libargon2-0, libcurl4, libedit2, libgd3, libmagickwand-6.q16-3, libonig4, libxml2
robdimsdale commented 1 year ago

Ok, thanks for clarifying.

What builder/stack are you using for the pack case @ramiyengar ? Debugging that will probably give some insight as to what's going on with the Korifi build

ramiyengar commented 1 year ago

I was using paketobuildpacks/builder:base. Switching to the full builder resolved this.