What is the easiest way to display PHP configuration using
phpinfo();
in a Laravel application, to debug local PHP configuration in a development environment?
Background:
I need to find out on my Mac, where brew placed the php.ini file which is read.
For Laravel ..routes\web.php
add:
Route::get('phpmyinfo', function () {
phpinfo();
})->name('phpmyinfo');
Then in your URL type yourdomain.com/phpmyinfo
Go to Laravel folder
/public
open
index.php
Look for the comment block
|---------------------
| Run The Application
|---------------------
Under that block just place
phpinfo();
Then start Laravel application with
php artisan serve
And open the application in browser. Don't forget to remove the line.
Please note:
This is only for local debugging purposes, as you reveal confidential information about PHP config.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With