I've upgraded a Joomla 3.10 website to 4.x. I use custom scripts on the website wich use the framework and that worked fine until after the upgrade.
I did some searching and since the framework got an update i updated the framework and changed the script to reflect the changes. I downloaded the new framework from GitHub and installed it with composer.
However, i'm just getting a blank page. The code for the script is:
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
define('_JEXEC', 1);
define('JPATH_BASE', __DIR__);
require_once '/home/dfk/domains/dfk.be/public_html/libraries/src/Factory.php';
require_once '/home/dfk/domains/dfk.be/public_html/libraries/src/User/User.php';
// Initialize the application
$app = JFactory::getApplication('site');
$app->initialise();
use Joomla\CMS\Factory;
use Joomla\CMS\User\User;
// Initialize the application
$app = Factory::getApplication('site');
$app->initialise();
$user = User::getInstance();
$userID = $user->id;
$username = $user->username;
echo "UserID:" . $userID;
?>
I get no output at all, not even the "UserID:" string. No errors, so very hard to troubleshoot.
I've googled and tried some suggestions and nothing worked. Also tried some ChatGPT suggestions ;), but that didn't help either.
Is there anyone who has any tips on what could be wrong? Thanks in advance.