-
Notifications
You must be signed in to change notification settings - Fork 11
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
php cli is not in $PATH #425
Comments
You're right that it's not available on the final image. Your reasoning for including it seems reasonable though. Could you possibly provide a more concrete example of an app which needs access to PHP on the final image? |
Most frameworks come with a console component which runs on the CLI to run, e.g. to generate assets, setup caches, houskeeping tasks, etc.. In order for them to run, most have a shebang such as: https://github.com/laravel/vapor-cli/blob/c4d8c043372bcb7409060be3b36dbbd62fcfb879/vapor#L1 |
@till could you provide some more concrete reproduction steps for this issue? I see your PR but I'm still a bit confused about why it's necessary. The lifecycle should automatically add the |
@thitch97 It's not in the launch environment though. So php console applications don't run. Am I missing something? |
@till How were you trying to invoke the app/inspect the launch environment? I'm able to use the CLI and see
The |
I was able to shell out to the php CLI from within a sample app as follows: app.php: <?php
#!/usr/bin/env php
echo "Hello world";
?> Procfile:
Build and run the app with:
I know this is using the full php buildpack, not just php-dist in isolation, but I think it demonstrates that the php buildpack supports applications which shell out to the CLI. |
Thanks, that got me on the right track. Sorry for the noise, so much to learn. 🙈 What are the situations where the As in, I see the following in the image's
|
@till this is a little confusing (at least to me) but I'll try to explain it as I understand it. The The process types are defined by the buildpack process. In the example I gave above, you can see there is one process:
If you want to run a command that isn't defined in the process list, you can do that, but the There is more information on the |
Thanks for all the help with this. I am closing this as it works. |
Expected Behavior
I can use the
php
cli inside my image:Current Behavior
Possible Solution
Add the layer to the
PATH
, or install in a location that is inPATH
already.Steps to Reproduce
Discovered this while fiddling with paketo-buildpacks/composer-install#46
Motivations
Lots of projects distribute command line tools that rely on the
php
(cli) to be inPATH
. These are broken now.In addition, there are so-called phars, which are php apps distributed as an executable archive. They also rely on the cli to be in
PATH
.The text was updated successfully, but these errors were encountered: