Skip to content
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

ini file with auto_prepend_file doesn't work with router.php #71

Closed
DanielRuf opened this issue Sep 23, 2021 · 2 comments
Closed

ini file with auto_prepend_file doesn't work with router.php #71

DanielRuf opened this issue Sep 23, 2021 · 2 comments

Comments

@DanielRuf
Copy link

DanielRuf commented Sep 23, 2021

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 DanielRuf changed the title auto_prepend_file not supported ini files not working with router.php Sep 23, 2021
@danielbachhuber
Copy link
Member

Thanks for the report, @DanielRuf !

Were you ever able to track down the root cause or identify a workaround?

@danielbachhuber danielbachhuber changed the title ini files not working with router.php ini file with auto_prepend_file doesn't work with router.php Jan 30, 2023
@DanielRuf
Copy link
Author

It's because router.php does not look for or load any ini files.

Keep in mind that .user.ini is expected to be in specific folders and PHP has to be configured to look there.

I guess there is no other solution for the PHP CLI - the c parameter is probably the right solution for testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants