No Code Attached Yet
avatar IL-accountuser
IL-accountuser
8 Oct 2025

Steps to reproduce the issue

Host Joomla 5.3.4 on a Windows Server (IIS) managed with Plesk.

Open Plesk → Scheduled Tasks.

Create a new task:

Task type: Run a PHP script

Script path:

iduminalanka.com\cli\joomla.php

Arguments:

session:gc --live-site="https://www.iduminalanka.com/"

PHP version: 8.4.7 (also tested with 8.2+)

Click Run Now.

Expected result

The Joomla CLI command should execute successfully and perform the built-in session:gc cleanup without any errors.

Actual result

The task fails immediately with the following error:

RuntimeException (#775)
#message: "Could not parse the requested URI http://%27httpsD:\InetPub\vhosts\cinsrilk-2473.package\iduminalanka.com\cli/"
#code: 0
#file: "D:\InetPub\vhosts\cinsrilk-2473.package\iduminalanka.com\libraries\vendor\joomla\uri\src\AbstractUri.php"
#line: 367

System information (as much as possible)

Joomla version: 5.3.4

PHP version: 8.4.7 (also tested with 8.2.x)

Database: MariaDB 9.6

Operating system: Windows Server (IIS)

Hosting control panel: Plesk

Site URL: https://www.iduminalanka.com/

Additional comments

The issue is reproducible using Joomla’s built-in CLI command session:gc, confirming it is not related to any third-party extension.

The error occurs during Joomla’s URI parsing stage when the --live-site parameter is included.

It appears to be a Windows-specific problem in the Joomla CLI application’s handling of local paths and URI formatting.

The CLI should be able to parse the --live-site argument correctly regardless of the operating system.

Attachments:

scheduletask.png — Plesk scheduled task configuration

error.png — CLI runtime error message

Image Image
avatar IL-accountuser IL-accountuser - open - 8 Oct 2025
avatar joomla-cms-bot joomla-cms-bot - change - 8 Oct 2025
Labels Added: No Code Attached Yet
avatar joomla-cms-bot joomla-cms-bot - labeled - 8 Oct 2025
avatar brianteeman
brianteeman - comment - 8 Oct 2025

you should never ever need to use livesite

avatar IL-accountuser
IL-accountuser - comment - 9 Oct 2025
Image Image

without livesite,, we still get an error

avatar IL-accountuser
IL-accountuser - comment - 12 Oct 2025

please help

avatar IL-accountuser
IL-accountuser - comment - 14 Oct 2025

hello, can someone answer please

avatar Fedik
Fedik - comment - 14 Oct 2025

I cannot check on windows.
On linux php cli/joomla.php session:gc works fine.

Your error trace seems incomplete and does not show full information.
session:gc does not require Uri to work, it could be that some of installed extensions doing something strange.

avatar IL-accountuser
IL-accountuser - comment - 15 Oct 2025

I cannot check on windows. On linux php cli/joomla.php session:gc works fine.

Your error trace seems incomplete and does not show full information. session:gc does not require Uri to work, it could be that some of installed extensions doing something strange.

Thank you for the reply, Fedik.

Just to clarify — the issue doesn’t seem related to any third-party extensions. The error occurs before any extensions or application code are loaded. The CLI fails inside Joomla’s own URI helper class on Windows.

From what I’ve observed (and confirmed with someone who investigated this deeper), the problem is specific to Windows. The Joomla CLI application appears to ignore both the --live-site argument and the $live_site value in configuration.php. Instead, it attempts to infer the site URL from the Windows environment variables. That logic seems to assume that on Windows, the process is always running under IIS, which is not true for CLI mode.

Because of this, URI::getInstance() ends up building an invalid URL like:

http://%27httpsD:\InetPub\vhosts...

So the failure isn’t related to the command (session:gc) itself or any installed extension — it’s due to how Joomla’s URI parsing behaves under Windows CLI. The same command runs fine on Linux, but the environment detection on Windows triggers this URI error.

please help

avatar brianteeman
brianteeman - comment - 15 Oct 2025

This is not about the operating systems windows or Linux. This is about the web server IIS compared to Apache.

Although officially IIS is supported there are very few users of this web server here.

avatar brianteeman
brianteeman - comment - 15 Oct 2025

to be honest I am surprised that anything works with Joomla works on IIS as I doubt anyone tests it. I did try earlier today to setup IIS for testing myself but gave up. If the project was honest it would remove any mention of IIS support

avatar leeroy1821
leeroy1821 - comment - 15 Oct 2025

Not an IIS issue. This is Joomla CLI.

Problem: URI::getInstance must work on CLI, but inside it at lines 86‑103 we see:

if (!empty($_SERVER['PHP_SELF']) && !empty($_SERVER['REQUEST_URI'])) {

On my Windows machine $_SERVER['PHP_SELF'] is empty. The code goes to the else branch:

$theURI = 'http' . $https . $_SERVER['HTTP_HOST'] . $_SERVER['SCRIPT_NAME'];

$_SERVER['HTTP_HOST'] comes from Joomla\CMS\Application\ConsoleApplication::populateHttpHost and it returns joomla.invalid.

But $_SERVER['SCRIPT_NAME'] is also empty on my Windows. Strange. I think the host of @IL-accountuser put the Joomla CLI directory in it:

D:\InetPub\vhosts\cinsrilk-2473.package\iduminalanka.com\cli

So when code builds $theURI it puts that whole folder into SCRIPT_NAME, making a bad URL.

Solution: In the file libraries/src/Application/ConsoleApplication.php after line 539, add this line:

$_SERVER['PHP_SELF'] = ($_SERVER['PHP_SELF'] ?? '') ?: (JPATH_ROOT . '/cli/joomla.php');

Now $theURI becomes correct and CLI works fine.

(I translated with ChatGPT. It is better than my bad English.)

Add a Comment

Login with GitHub to post a comment