How to not load `local-bootstrap.php` file

Issue Summary

The included local-bootstrap.php file inside the application contains a single line.

define( 'WP_ENVIRONMENT_TYPE', 'local' );

This is fine, except that there are other plugins, including ones I develop, that define this constant. It results in a PHP error. It’s not really necessary for Local to define this constant, especially as there doesn’t seem to be an easy way to stop this action.


This will happen for any site that may also define this constant.

System Details

  • Which version of Local is being used?
    Local or Local Beta, latest versions

  • What Operating System (OS) and OS version is being used?
    macOS Big Sur

I turn off local-bootstrap.php loading by editing the conf/php/php.ini.hbs file for any given site, and changing the line with the auto_prepend_file directive so it reads:

auto_prepend_file = none

Unfortunately in v5.10.0 there is more in the local-bootstrap.php file that just this define.

Not autoloading will result in less functionality.

Ah, that definitely adds another dimension to the problem. I wonder if local-bootstrap.php could load a custom bootstrap file if it exists, and if not fall back to the LocalWP default? That would keep things simple for people not needing any customisation, but still make it easy to customise if/as required. That becomes a feature request, though, so not a quick fix.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.