# Using Log1x / sage-directives with sage9/php8.1

**URL:** https://discourse.roots.io/t/using-log1x-sage-directives-with-sage9-php8-1/26966
**Category:** sage
**Tags:** sage9
**Created:** 2024-04-09T20:01:31Z
**Posts:** 9

## Post 1 by @Erwin_Wijnveld_BOOOM — 2024-04-09T20:01:31Z

When i update my sage9 installation to php8.1 using this article: [Is there a way to use Sage 9 with PHP 8.1? - #2 by evance](https://discourse.roots.io/t/is-there-a-way-to-use-sage-9-with-php-8-1/24435/2) my sage directives stop working.

Is there a workaround for this?

---

## Post 2 by @evance — 2024-04-10T06:49:44Z

Could you specify on what sage directives you are using? Code examples?

---

## Post 3 by @Erwin_Wijnveld_BOOOM — 2024-04-10T12:10:16Z

Thanks for the reply!  
This is my composer.json:

```
{
  "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": "^7.4|^8.0",
   	"composer/installers": "^2.0",
    "roots/sage-installer": "^2.0",
    "roots/sage-lib": "dev-master",
    "soberwp/controller": "~2.1.0",
    "roots/sage-woocommerce": "^1.0",
    "log1x/sage-directives": "^1.1",
    "stoutlogic/acf-builder": "^1.10"
  },
  "require-dev": {
    "squizlabs/php_codesniffer": "^2.8.0"
  },
  "scripts": {
    "test": ["phpcs"],
    "post-create-project-cmd": [
      "Roots\\Sage\\Installer\\ComposerScript::postCreateProject"
    ]
  },
  "config": {
    "allow-plugins": {
      "kylekatarnls/update-helper": false,
      "composer/installers": true
    }
  }
}
```

Now i am talking about log1x/sage-directives which stopped working.

---

## Post 4 by @evance — 2024-04-10T13:33:44Z

Do you get an error of some sort running `composer update` in your theme folder with this setup?

What do you refer to when saying

> my sage directives stop working

? Any errors here?

Please post them.

Also: As you are not using `log1x/blade-svg-sage` then you might have to explicitely `composer require illuminate/support`.

---

## Post 5 by @Erwin_Wijnveld_BOOOM — 2024-04-18T08:04:03Z

It doesnt compile anymore in the uploads/cache files, so it for example shows @field(‘test’) instead of the compiled PHP

---

## Post 6 by @evance — 2024-04-22T13:52:42Z

Maybe check if ACF is activated? Judging by [the docs](https://log1x.github.io/sage-directives-docs/usage/acf.html#field) this could well be the explanation (no error thrown, `@field` showing in cache files)…?

_The following directives are for use with Advanced Custom Fields. If ACF is not installed and activated, they will not be initialized._

Otherwise I am clueluess and cannot offer any more help, sorry…

---

## Post 7 by @herdl-ash — 2024-05-17T14:26:02Z

@Erwin_Wijnveld_BOOOM were you able to find a solution here?

I have a similar problem, soberwp/controller stopped working.

---

## Post 8 by @ben — 2024-05-21T16:43:17Z

For posterity, [this was solved in @herdl-ash’s new topic](https://discourse.roots.io/t/are-there-solutions-to-get-soberwp-controller-working-with-sage-9-and-php-8-1/27180)

---

## Post 9 by @ben — 2024-05-21T16:43:22Z


