Tribe Support

Tribe Support's Topics

Justin Schmitt

3 weeks ago

Uncaught Error: Call to a member function getRouter() on null

Hi everyone,

I'm new to Anahita and I'm attempting to try it out locally.  I'm using the latest version of PHP 7 with Apache2 and Debian Buster.  I have APCU, Mysqli and OPCache modules installed and enabled.  I've also enabled mod_rewrite on Apache.  Everything else is set to system defaults.

I've followed the README instructions, pointed Anahita to a Mysql instance that I already had running, and it successfully connected, created the schema, and initiated the site.

However, I get the following message when attempting to load the site... does anyone have a suggestion on how I might troubleshoot this?:

Fatal error: Uncaught Error: Call to a member function getRouter() on null in/components/com_application/dispatcher.php:164

Hi Justin, thank you for reporting the issue. I am going to see if I can reproduce the issue and get back to you. It looks like for some reason $this->_application isn't being assigned.
Thanks Rastin, let me know if there's anything else you need from me.
Rastin Mehr liked this
Rastin, I was able to get it up and running by rolling back the version of PHP. I first rolled back to version 7.3.14 and I was able to mostly load the site, but the home page showed the error:

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 10 in /var/www/html/myproject/vendor/anahita/anahita/src/libraries/anahita/filter/term.php on line 40

Next, I rolled back one more minor version to PHP 7.2.27, and it now appears that everything is working without issue!

Hopefully this info is helpful for you!
Rastin Mehr liked this
Thank you, Justin! You saved me a lot of time. If you could please do a PR on Github, I'll appreciate it. Otherwise, I'll do a fix and make a new release this weekend.
I'm not sure what to update in the Anahita code to make it work with the latest version of PHP, but I can submit a PR for the README, if that's what you meant.
No problem then, We'll do it!
So other than a warning, Anahita works with PHP 7.3.9, but we need to do some extensive work for upgrading to PHP 7.4 following this guideline:
I'm going to do a release tomorrow with a note that PHP 7.3.9 is the upper limit for now.
So I just created the Anahita 4.4.3 birth release, and it should work on PHP 7.3.9 and lower, but not on PHP 7.4 yet. The list of required changes for PHP 7.4 is extensive, and it will take a while for us to finish it. If you could give us a hand, let me know. We'll appreciate it.

Powered by Anahita