Pages not pulling through properly

Hi there,

I recently moved a website from IIS to HestiaCP and all is working fine. I have 2 pages that aren’t working as intended.

After reviewing the logs on HestiaCP I get the following errors on the pages that I am working on

[Wed Mar 27 10:58:59.259637 2024] [proxy_fcgi:error] [pid 3621426:tid 139754083419712] [client random IP] AH01071: Got error ‘PHP message: PHP Warning: array_diff(): Expected parameter 1 to be an array, bool given in /path/to/website/domain.com/public_html/articles_index.php on line 457PHP message: PHP Warning: natsort() expects parameter 1 to be array, null given in /path/to/website/web/webdomain.com](http://domain.com)/public_html/articles_index.php on line 458PHP message: PHP Warning: Invalid argument supplied for foreach() in /path/to/website/domain.com/public_html/articles_index.php on line 461’, referer: https://adomain.com/parent_hub.php?id=3248c518-3a37-4633-b807-666e29811fdb
[Wed Mar 27 11:00:08.701441 2024] [proxy_fcgi:error] [pid 3621427:tid 139753965921856] [client Random IP0] AH01071: Got error ‘PHP message: PHP Warning: array_diff(): Expected parameter 1 to be an array, bool given in /path/to/website/domain.com/public_html/articles_index.php on line 457PHP message: PHP Warning: natsort() expects parameter 1 to be array, null given in /path/to/website/public_html/articles_index.php on line 458PHP message: PHP Warning: Invalid argument supplied for foreach() in /path/to/website/public_html/articles_index.php on line 461’, referer: https://webdomain.com/parent_hub.php?id=3248c518-3a37-4633-b807-666e29811fdb

Just hiding the correct directories and domain for security reasons. After checking the above mentioned lines, the culprit seems to be the following. But I am not familiar with PHP at all, I have the correct version of PHP installed, as well as checking all the rights.

Page displays but content doesn’t

       if (isset($chi->chi_expiry_dt) && ($chi->chi_expiry_dt > date("Y-m-d H:i:s")) || (isset($usr->usr_sub_expiry_dt) && ($usr->usr_sub_expiry_dt > date("Y-m-d H:i:s")))) {
            $baseArticlesUrl = '/content/articles/';
            // $baseUrl = '/content/articles/*'.$folderName.'/*.htm';

            $articleDirectories = array_diff(glob($_SERVER['DOCUMENT_ROOT'] . str_replace("/", "\\", $baseArticlesUrl), GLOB_ONLYDIR), array('.', '..'));
			natsort($articleDirectories); // sort the array the way a human would read it i.e. 2-3 < 10-11 instead of the standard "10-11" < "2-3" string comparison logic
			//echo(print_r($articleDirectories,true));

            foreach($articleDirectories as $articleDirectory) {
                $folderName = substr($articleDirectory,strlen($_SERVER['DOCUMENT_ROOT'].'//content//articles//'));
                if (strpos($folderName,'Month') === false) {
                    continue;
                }