-
Notifications
You must be signed in to change notification settings - Fork 11.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
Built-in health up/
route view does not respect the APP_BASE_PATH
environment variable
#54310
Comments
Hey there, thanks for reporting this issue. We'll need more info and/or code to debug this further. Can you please create a repository with the command below, commit the code that reproduces the issue as one separate commit on the main/master branch and share the repository here? Please make sure that you have the latest version of the Laravel installer in order to run this command. Please also make sure you have both Git & the GitHub CLI tool properly set up.
Do not amend and create a separate commit with your custom changes. After you've posted the repository, we'll try to reproduce the issue. Thanks! |
Why would you want to change the And if you're looking to make it configurable, would something like this suffice? // Config uses an environment variable
$healthUpViewPath = config('app.health_up_view_path', __DIR__.'/../resources/health-up.blade.php');
return response(View::file($healthUpViewPath, [
'exception' => $exception,
]), status: $exception ? 500 : 200); |
@danielh-official Hmm, that might work but isn't ideal. I started my project in Laravel 5 and I have been upgrading continuously to v11. I know that some views could be published (copied to views dir). This route isn't published in my setup and I don't know if the health route feature supports publishing at all.
|
As Laravel is an open source project, we rely on the community to help us diagnose and fix issues as it is not possible to research and fix every issue reported to us via GitHub. We're closing this for now due inactivity or progress. However, a pull request fixing the issue you have described, along with corresponding tests is always welcome. All pull requests are promptly reviewed by the Laravel team. Thank you! |
Laravel Version
11.39.1
PHP Version
8.2
Database Driver & Version
Not relevant
Description
When running
php artisan optimize
, I noticed the built-in healthup/
route does not respect theAPP_BASE_PATH
environment variable. IfAPP_BASE_PATH
differs from__DIR__
, this causes the cached path to become invalid. After investigating, I traced the issue to the following file and lines:src/Illuminate/Foundation/Configuration/ApplicationBuilder.php
:It might be necessary to publish the view into the views directory first, though I couldn’t find documentation mentioning that. For now, I’ll just disable the
up/
route in optimized deployments whenAPP_BASE_PATH
is set.Steps To Reproduce
Application::configure
to enable the health path.export APP_BASE_PATH=[YOUR_SYMLINK_PATH]
php artisan optimize
~/bootstrap/cache/routes-v7.php
), and you’ll see the path forup/
does not begin withAPP_BASE_PATH
.The text was updated successfully, but these errors were encountered: