# Are there solutions to get SoberWP Controller working with Sage 9 and PHP 8.1?

**URL:** https://discourse.roots.io/t/are-there-solutions-to-get-soberwp-controller-working-with-sage-9-and-php-8-1/27180
**Category:** sage
**Tags:** sage9
**Created:** 2024-05-20T18:49:14Z
**Posts:** 3

## Post 1 by @herdl-ash — 2024-05-20T18:49:14Z

Hi all,

I’ve got a couple of projects that’s built on Sage 9. So far I was able to use the solution in [this article](https://discourse.roots.io/t/is-there-a-way-to-use-sage-9-with-php-8-1/24435/2) but it recently stopped working and Wordpress returns a Fatal error.

**The error message:**

```
( ! ) Fatal error: Uncaught ReflectionException: Class "App\Controllers\App" does not exist in /www/kinsta/public/wordpress-test/wp-content/themes/sage_9.1/vendor/soberwp/controller/src/Loader.php on line *75*
( ! ) ReflectionException: Class "App\Controllers\App" does not exist in /www/kinsta/public/wordpress-test/wp-content/themes/sage_9.1/vendor/soberwp/controller/src/Loader.php on line *75*
```

**This is my composer.json file**

```
{
  "name": "roots/sage",
  "type": "wordpress-theme",
  "license": "MIT",
  "description": "WordPress starter theme with a modern development workflow",
  "homepage": "https://roots.io/sage/",
  "authors": [
    {
      "name": "Ben Word",
      "email": "ben@benword.com",
      "homepage": "https://github.com/retlehs"
    },
    {
      "name": "Scott Walkinshaw",
      "email": "scott.walkinshaw@gmail.com",
      "homepage": "https://github.com/swalkinshaw"
    },
    {
      "name": "QWp6t",
      "email": "hi@qwp6t.me",
      "homepage": "https://github.com/qwp6t"
    }
  ],
  "keywords": ["wordpress"],
  "support": {
    "issues": "https://github.com/roots/sage/issues",
    "forum": "https://discourse.roots.io/"
  },
  "autoload": {
    "psr-4": {
      "App\\": "app/"
    }
  },
  "repositories": [
    {
      "type": "vcs",
      "url": "https://github.com/jeh5256/sage-installer"
    },
    {
      "type": "vcs",
      "url": "https://github.com/jeh5256/sage-lib"
    }
  ],
  "require": {
    "php": "^8.1",
    "composer/installers": "^2.0",
    "soberwp/controller": "~2.1.0",
    "roots/sage-installer": "^2.0",
    "roots/sage-lib": "dev-master"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^2.8.0"
  },
  "scripts": {
    "test": [
      "phpcs src --extensions=php --standard=PSR2"
    ],
    "post-create-project-cmd": [
      "Roots\\Sage\\Installer\\ComposerScript::postCreateProject"
    ]
  },
  "config": {
    "allow-plugins": {
      "kylekatarnls/update-helper": true,
      "composer/installers": false
    }
  }
}
```

This only stopped working a couple of days ago. If I downgrade the PHP to 8.0 then there are no issues.

Thanks in advance.

---

## Post 2 by @evance — 2024-05-21T14:39:33Z

Which **WordPress** - & **PHP** -version are you using when the error occurs?

See this thread: [Uncaught ReflectionException after composer update · Issue #55 · soberwp/controller · GitHub](https://github.com/soberwp/controller/issues/55)

---

## Post 3 by @herdl-ash — 2024-05-21T15:02:14Z

Thanks @evance! It was exactly that, I found that a couple of hours ago.

Had to update my controllers from this

 ![image](https://discourse.roots.io/uploads/default/original/2X/c/c36594a0e83b451d92f31ba4820765b892255d08.png)

To this

 ![image](https://discourse.roots.io/uploads/default/original/2X/b/b97f57a1d466ecf1c70923cf236c377cff95fc52.png)

I’m using WordPress 6.5.3 and PHP 8.2
