XF 2.2 index.php Unexpected content

shyamdev

Member
Hi Can anyone review or share the default code for index.php

I am getting filecheck error /alerts - Unexpected content, not sure I modified anything is there a way to check the original code version of this index.php file ?

Can anyone share their version of this file for me to compare, I can ignore but curious why it is throwing this alert, my site is working fine


File health check results​

Error:
index.php Unexpected content

----code below--
<?php
$phpVersion = phpversion();
if (version_compare($phpVersion, '7.0.0', '<'))
{
die("PHP 7.0.0 or newer is required. $phpVersion does not meet this requirement. Please ask your host to upgrade PHP.");
}

$dir = DIR;
require($dir . '/src/XF.php');

XF::start($dir);

if (\XF::requestUrlMatchesApi())
{
\XF::runApp('XF\Api\App');
}
else
{
\XF::runApp('XF\Pub\App');
}
 
PHP:
<?php

use XF\Api\App as ApiApp;
use XF\Pub\App as PubApp;

$phpVersion = phpversion();
if (version_compare($phpVersion, '7.2.0', '<'))
{
    die("PHP 7.2.0 or newer is required. $phpVersion does not meet this requirement. Please ask your host to upgrade PHP.");
}

$dir = __DIR__;
require $dir . '/src/XF.php';

\XF::start($dir);

if (\XF::requestUrlMatchesApi())
{
    \XF::runApp(ApiApp::class);
}
else
{
    \XF::runApp(PubApp::class);
}
 
Thank you. I tried the above code did not work but downloading the file from my xenforo customer area account and overwriting existing fixed the error, I comparted the code and found few white spaces and other things shown as mismatch

Thank you @Old Nick and @Jeremy P for quick suggestions and help


New --------------------------------------------------------------------------------------- old errored-----------------------------------
1720832934267.webp
 
Last edited:
Back
Top Bottom