Two error messages in error_log about advisory block and quakes block (SOLVED)

Hello all,

Have two error messages in the log, see error_log.png.

One concerns the “advisory_c_small” block, which also keeps running without giving a result. The error message then refers to the file “wrnWarningEU-CAP.php” line 153.
See screenshot.

The other error comes from the “PWS_quakes_load.php” block and then lines 59 and 62, see also the error_log here.

All modules are provided with the latest updates.

I wonder where it goes wrong.

Thank you!

gr. Arie


That seems to be a severe error. I can not replicate it with NL011, NL11 or BE004 as warning area.
What is / are the warning areas in your settings?
I need those to further test.

Sometimes the .cap file contains large amounts of duplicate entires.
If the problem persists (with one area also) you could switch to one of the other EU warning settings
Lines 6-7 in wrnWarningEU.php can be set to use CAP (which you are not using, ATOM or RSS.
The output is different for those 3 versions, but usable.

The other error comes from the "PWS_quakes_load.php" block and then lines 59 and 62, see also the error_log here.
. . . l/pwsWD/_test.php?test=PWS_quakes_load.php&json&force This switches error reporting on and reloads the xml. When I test it locally with PHP 8.1.1 there are no errors in the log and both the xml and json seems OK

It could have been a one-time only set of erros caused by mal-formed xml.
I will test it a few times the coming days to see if the problem persists.

. . . Thank you!

gr. Arie

Hello Wim,

It found out that it has something to do with the PHP version, I went now back from 8.1 to 7.4 and the problem has gone with the advisory_c_small block (I used the latest one from 26 feb).
But why?

I use NL015
Settings in wrnWarningEU.php:

[i]<?php $scrpt_vrsn_dt = ‘wrnWarningEU.php|09|2021-08-03|’; # new / old formatstimout to 10 seconds | release 2012_lts

These are the scripts to use for the website

Be warned that you have to find the new area codes, visit the wwforum topic

#$script = ‘wrnWarningEU-RSS.php’; // old fashined feed
#$script = ‘wrnWarningEU-ATOM.php’; // use this one if both others fail
$script = ‘wrnWarningEU-CAP.php’; // latest version

#$script = false; // if you do not comment this line the script is used

$legal = '


Any suggestions?


gr. Arie

More testing done.
Problem 1:
The warning-feed for NL015 (Netherlands) is really big. And, currently, contains only irrelevant data.
Total 5534 messages of which 287 for NL015 of which 0 (zero) of any importance.

The warning-feed for BE004 (Belgium) has 24 messages, all relevant but none for the BE004 area.

Problem 2:
Due to the size and thew slow server-speed there could be time-outs
=> adapted the script to change transfer time-out from 10 to 20 seconds

Problem 3:
Due to the large file-size your server-max memory limit is set to low.
It is now set (in your PH8.1 version ) at 32MB but with this file-size it needs 99.39 mb(104218624 bytes).
Probably it is a higher memory setting with PHP 7.
Use your "c-panel " at your hosting site to check the memory allowed. Set it to 128 mb.
If there are more PHP 8 versions test those also. Sometimes an error occurs only in 1 version

The wrnWarningEU-CAP.php script will continue to fail (PHP 8.1) without the adequate memory size-setting for as long as that file is that big.

I tested multiple times and always similar results with download times between 9 and 11 seconds.
Tested with two region-codes BE004,NL015 :
[size=66][font=courier]wrnWarningEU-CAP.php (122) areas=BE004, NL015 countries=BE, NL
wrnWarningEU-CAP.php (445) BE_warnings: time spent: 0.5667 - CURL OK for
wrnWarningEU-CAP.php (445) NL_warnings: time spent: 10.0796 - CURL OK for[/font][/size]
No memory errors with a 128mb setting.

I add two changed scripts to test with.

EDIT 11:21
I tested with multiple PHP-versions. Memory size is similar

test.php (24): Max memory used: 97.41 mb(102141952 bytes). Duration: 13.88081 seconds. PHP_version: 7.4.21
test.php (24): Max memory used: 99.41 mb(104239104 bytes). Duration: 12.14294 seconds. PHP_version: 8.1.1

Also you could check using another adjacent area. The more then 500 “no-warnings” are for river high water in the “ijssel”

Wim (10.3 KB)

I’m getting these errors on is this the same issue

[28-Feb-2023 07:28:06 America/Boise] PHP Warning : simplexml_load_string(): Entity: line 1: parser error : Start tag expected, ‘<’ not found in /home2/scrapbin/public_html/mobi/PWS_quakes_load.php on line 59
[28-Feb-2023 07:28:07 America/Boise] PHP Warning : simplexml_load_string(): � in /…/public_html/mobi/PWS_quakes_load.php on line 59
[28-Feb-2023 07:28:07 America/Boise] PHP Warning : simplexml_load_string(): ^ in /…/public_html/mobi/PWS_quakes_load.php on line 59
[28-Feb-2023 07:28:07 America/Boise] PHP Warning : Invalid argument supplied for foreach() in /…/public_html/mobi/PWS_quakes_load.php on line 64


It seeems that sometimes the xml is damaged or not available.
That can give those warnings.
Better select in your hosting control-panel to not log those warning and notice messages.
There is nothing for you to do with those messages.

You can test the script . .
Or check the file . .
All data is recent.

I will check the script and add more test to discard the errornous data.


Fixed advisory block issue by increasing memory setting to 128MB for PHP version 8.1, that was the solution.
Also replaced wrnWarningEU-CAP.php by the new one, but without replacing it also works, so actually I think no need to replace.

When I tested the new “_test.php?test=PWS_quakes_load.php&json&force” it gives no errors, it all looks good.
But in the error.log the error comes back so about every one or two hours, see attachment.


Greetings Arie

error_log.txt (23.8 KB)

PHP Warning: simplexml_load_string(): Entity: line 1: parser error : Start tag expected, ‘<’ not found

The warning-messages occur when the retrieved xml data is “incorrect”.
That results in warnings.
The scripts can not use that data and the previous file is used.

Most of our data-providers are free to use: earthquake, metar, a few forecasts and so on.
Often a pet-project of a smal group or only 1 individual.
Invalid data can happen and I try in my “1 person PWS_Dashboard” project to cope as good as free time permits.

You should switch of the reporting of warnings and notices. They are not errors. Errors will be removed a.s.a.p.
And as posted earlier, with “[color=blue][b]GIGA[/b][/color]” data warnings will be generated.


Why do we see all those messages nowadays:
With PHP 5.6 and 7.x the default webhosting setup was “no messages”
Starting with PHP 8.0 most providers use the new dewfault => show all messages.
Let users decide in their “cPanel” which messages should be shown.

That generates losts of messages, even notices to change scripts because PHP 9 will not support something.

But if the providers do not warn their users we are wasting time on messages.

When switching to PHP 8 check and adapt your webhosting PHP message setting

PHP Memory setting: Same problem when a provider does not warn users for to small memory setting in PHP 8.

@ALL => please test adapted quake-MITM script

Added extra error-checking and would like to know if the warning messages are removed.
As mentioned by the OP those messages occur ever so many hours.

Sadly my servers never showed those warnings,

Wim (2.54 KB)

Just uploaded the new file.
Will monitor the result.

By the way, it’s not a problem, the functionality does not suffer from the error messages in the log file.

gr. Arie

Yes, that is why I said already: switch off warning- and notice-messages.
And for a real 24/7 production website all messages should be switched off.

To find “hidden problems” or investigate more deeply, the _test.php script should be used as that script switches error reporting to the highest level before loading index.php

And the debug dashboard (PWS_module_test.php) let you test individual blocks with full error messaging.

Your current messages are warnings not errors.
An error can impact the functionality, but in most cases the scripts will adjust to that.
Most warnings and certainly all notices are informational meant for the developer to take future action.


Same, uploaded replacement file earlier, no errors
Thank you

No error messages have been seen so far, so it seems to be going well now.

After two days, no errors anymore, so problem solved.

A post was split to a new topic: Meteoalrm ATOM file empty, CAP version works