server-command icon indicating copy to clipboard operation
server-command copied to clipboard

ini files not working with router.php

Open DanielRuf opened this issue 4 years ago • 0 comments

Bug Report

It seems loading a config file with auto_prepend_file does not work with the router.php file. If I use the internal PHP server without this, it works.

https://github.com/wp-cli/server-command/blob/master/src/Server_Command.php#L90

This works without any problems:

php -c .../.user.ini -S localhost:8080 -t .

Describe the current, buggy behavior

php wp-cli.phar server --config=.user.ini

Describe how other contributors can replicate this bug

  • create a .user.ini file with a auto_prepend_file setting
  • run php wp-cli.phar server --config=.user.ini
  • open the browser
  • check if the file is actually executed (add an echo to it)

Describe what you would expect as the correct outcome

The ini file should be loaded and the auto_prepend_file setting should work.

Let us know what environment you are running this on

(Paste the output of "wp cli info" into this box)

Provide a possible solution

If you happen to have a suggestion on how to fix this bug, please tell us in here.

Just leave this section out if you don't know how to fix it.

Provide additional context/Screenshots

Add any other context about the problem here.

If applicable, add screenshots to help explain (you can just drag&drop images into the Github issue).

DanielRuf avatar Sep 23 '21 22:09 DanielRuf