0

I'm working on a Joomla 4 website which is migrated from Joomla 3.11. Everything else is working fine except one page. These page is also rendered and further it loads data from a ajax request from the same server. The ajax request is failing. While troubleshooting the issue I found that jquery is trying to load PHP files directly. This is the jquery code which is loading php file.

jQuery.get( "components/com_mycomp/lib/common/load.php", {scope:"get_first_site"}, function(first_site) { .... }

When I navigate to this url (http://localhost/components/com_mycomp/lib/common/load.php) manually from the browser, it throws and exception: "Failed to start application" enter image description here

1
  • Sorry, posted in wrong forum
    – Ramesh Jangra
    Jun 14, 2023 at 12:42

1 Answer 1

0

It would appear that you are trying to load Joomla 4 using the code for Joomla 3 which I suspect is happening in the j_load.php file.

A similar question was answered recently, getMailer gives "Failed to start application" exception after updating to Joomla4, how do I fix it? that provides code that you could use to replace the Joomla 3 loading code.

Edit: 24/06/2023 Since I originally answered this question I have learnt more and posted a more complete answer in this post here with sample code for calling an instance of Joomla 4.

How to create an instance of the Joomla CMS from the browser or the command line

2
  • Thanks @Irata. I managed to execute my code by using define('NO_SESSION', 1); in my php file which further calls j_load.php. does it have any side-effect? Jun 15, 2023 at 2:10
  • That would depend on whether your extension needs to have or uses Sessions for subsequent access but if it is working for you than you are probably okay.
    – Irata
    Jun 15, 2023 at 5:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.