Problems after upgrading
« on: December 29, 2023, 08:17:47 PM »
We just upgraded our server to using php 8.2 and we upgraded our sitemap generator code as well.

Now when we run the sitemap generator, it creates the sitemap, but fills up our php log file with over 1GB of warnings.  I'm just assuming the sitemap file created is correct.

Can you fix?  Here's a sample from the logfile.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "ddbg" in /home/dozeman1/public_html/sitemap-generator/pages/class.utils.inc.php on line 107
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "" in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 116
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Trying to access array offset on value of type null in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 116
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_prev_sm_incl" in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 739
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_prev_sm_cache" in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 741
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_badreq_httpcode" in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 751
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_interrupt_httpcode" in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 753
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "path" in /home/dozeman1/public_html/sitemap-generator/pages/class.grab.inc.php on line 802
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_urlprefix" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 117
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "port" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 151
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "ddbg" in /home/dozeman1/public_html/sitemap-generator/pages/class.utils.inc.php on line 107
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "skipip" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 145
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_curlproxy" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 112
[29-Dec-2023 20:01:51 UTC] PHP Deprecated:  preg_match(): Passing null to parameter #2 ($subject) of type string is deprecated in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 112
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_extra_param" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 112
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_portconnection" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 113
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_portconnection" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 114
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "port" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 114
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_more_ips" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 126
[29-Dec-2023 20:01:51 UTC] PHP Deprecated:  trim(): Passing null to parameter #1 ($string) of type string is deprecated in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 126
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "req" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 120
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_crawl_ident" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 115
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_http_nogzip" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 121
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "addheaders" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 121
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_keep_alive" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 121
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "ddbg3" in /home/dozeman1/public_html/sitemap-generator/pages/class.utils.inc.php on line 107
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "ddbg" in /home/dozeman1/public_html/sitemap-generator/pages/class.utils.inc.php on line 107
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "ddbg3" in /home/dozeman1/public_html/sitemap-generator/pages/class.utils.inc.php on line 107
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "anytype" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
[29-Dec-2023 20:01:51 UTC] PHP Warning:  Undefined array key "xs_httplimit" in /home/dozeman1/public_html/sitemap-generator/pages/class.http.inc.php on line 146
Re: Problems after upgrading
« Reply #1 on: December 29, 2023, 08:37:37 PM »
Correction - we're on php v8.1.26.

sitemap generator v8.2

Re: Problems after upgrading
« Reply #2 on: December 30, 2023, 05:21:03 AM »
Hello,

those messages do not affect created sitemap and can be ignored. You can configure php to omit logging those for the time being.
Re: Problems after upgrading
« Reply #3 on: December 30, 2023, 01:41:25 PM »
Oleg -

Thanks for your quick reply.

We have php running throughout our site, so we can't disable php warning messages globally.  We have over 20,000 pages and need to know if there's an issue.

If those warning messages from sitemap generator can be ignored, can you add "error_reporting(E_ERROR);" or "error_reporting(-1);" to the beginning of the sitemap script so it's disabled for sitemap generator only?

That could be a quick fix for now, and then eventually maybe you could even add that into the configuration options?



Brian

Re: Problems after upgrading
« Reply #4 on: December 30, 2023, 02:51:32 PM »
>We have over 20,000 pages and need to know if there's an issue.
That's not an issue.

Error messages output is already suppressed in generator script, but looks like file logging is still enabled due to server configuration.
Re: Problems after upgrading
« Reply #5 on: December 30, 2023, 03:13:31 PM »
I think you misunderstood - we have over 20,000 php pages on our website, and so we can't globally disable php warnings in the log file in case there are issues with the website.

So, we need to disable warning messages for just the sitemap generator php script.

What's the best way to do that?



Re: Problems after upgrading
« Reply #7 on: January 02, 2024, 12:40:26 AM »
So, the only way we know of to disable php warning messages on an individual script level is to add a line of code to the php script.

Could you provide a version of the script with the single line "error_reporting(0);" added?  That should do the trick.

Re: Problems after upgrading
« Reply #8 on: January 02, 2024, 11:40:08 AM »
Hello,

the script already has error_reporting(E_ERROR); line which should suppress warning messages.
Re: Problems after upgrading
« Reply #9 on: January 02, 2024, 03:05:51 PM »
But it's not suppressing warning messages, as you can see in the sample log file I provided above.

In fact, it's generating almost 3GB of warning messages when it's run.

So I really need the script to suppress those warning messages.  It's not doing it now.  That's the problem.

Re: Problems after upgrading
« Reply #10 on: January 02, 2024, 04:15:56 PM »
You can try to put this at the top of index.php file:
ini_set('log_errors', false);