Built-in health up/
route view does not respect the APP_BASE_PATH
environment variable
#54310
Labels
up/
route view does not respect the APP_BASE_PATH
environment variable
#54310
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: