Closed bobbingwide closed 6 years ago
Note: It was not the same problem as detected with notices from WP-CLI, which was:
Notice: Undefined index: SERVER_NAME in
phar://path-to-file/wp-cli.phar/php/WP_CLI/Runner.php(982) :
eval()'d code on line 18
This bug was easily tracked down. I switched to PHP 7.1, where Xdebug was enabled to automatically produce a stack trace on Notices. This showed that the problem was due to referencing $_SERVER['SERVER_NAME']
in wp-config.php
.
I've added logic, in oik_batch_set_domain()
, to set the value to null
if it's not set. This'll let wp_get_server_protocol
apply the default.
I'll consider raising a WordPress TRAC.
Automatically setting WP_CLI doesn't work since other plugins can break if WP_CLI is set but not actually loaded e.g. Akismet.
For the actual plugin that's failing ( qtranslate-x) setting WP_ADMIN doesn't work either. WordPress core baulks since PHP_SELF does not contain wp-admin
.
When running oik-wp.php, some installation's produce a notice from wp_get_server_protocol() when a loaded plugin calls a function that uses wp_get_server_protocol(). More often than not the process then dies.
Possible solutions
Note: Check if this is the same problem as detected with Notices from WP-CLI.