Jump to content

Undefined array key "SCRIPT_NAME" in wire/core/ProcessWire.php on line 1175


kylxbn
 Share

Recommended Posts

Hello. Can someone please help me fix an issue I am having? This doesn't show up before but when I logged in today, it started to show and I can't log into the admin page. This is the full error that shows up on the page:

Warning: Undefined array key "SCRIPT_NAME" in /home/public/*******/wire/core/ProcessWire.php on line 1175
Deprecated: dirname(): Passing null to parameter #1 ($path) of type string is deprecated in /home/public/********/wire/core/ProcessWire.php on line 1175

If I were to think of a possible reason for this problem, maybe it's because I started using CloudFlare DNS?

Anyway, I am using ProcessWire 3.0.229 on PHP 8.2 but it also happens on PHP 8.1. I checked the relevant line in the file and here it is:

if(is_null($_rootURL)) $rootURL = rtrim(dirname($_SERVER['SCRIPT_NAME']), "/\\") . '/';

I read about the function of SCRIPT_NAME and I don't think it's supposed to be undefined on $_SERVER so why is it null in my case? For reference, I have another ProcessWire site and the error doesn't happen there. And that website's domain is not using CloudFlare DNS. Hmm.

Should I report this as a bug in the issue tracker?

Any help is greatly appreciated! Thanks!

Link to comment
Share on other sites

I vaguely recall this happening to me too. But that was a while back for me to know how it got fixed.

Have you tried checking your httpHosts in config is complete?

$config->httpHosts = array('localhost','yourdomain.com')

or ensure you have the correct index.php & .htaccess that goes with ProcessWire 3.0.229?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...