Roots Discourse

First Sage Install, loaded with PHP errors

Hello everyone. I am trying out Sage, Bedrock and Trellis for the first time. I got it all up and running but I am receiving a vast amount of PHP Errors right out the gate. It’s to the point where you can’t use the WP Admin menu without disabling WP_DEBUG. Is this whats supposed to happen? Thank you for any help.

Here’s the errors:

Deprecated: Method ReflectionParameter::getClass() is deprecated in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php on line 826

Deprecated: Method ReflectionParameter::getClass() is deprecated in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php on line 900

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 111

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 135

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 167

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 180

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 220

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 260

Warning: Private methods cannot be final as they are never overridden by other classes in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/soberwp/controller/src/Controller.php on line 281

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-includes/functions.php on line 6712

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-admin/includes/misc.php on line 1310

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-admin/admin-header.php on line 9

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-includes/option.php on line 1097

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-includes/option.php on line 1098

Welcome! It looks like you’re using Sage 9 with PHP 8.x? Can you provide more details about your setup?

You’ll probably want to use Sage 10 if you’re using PHP 8.x to avoid warnings

1 Like

Thank you and Sure thing. I actually just followed the guide lol. I thought I downgraded my PHP to 7.4 though. So I used this command to install sage

$ composer create-project roots/sage your-theme-name


➜  trellis php --version
PHP 7.4.27 (cli) (built: Dec 16 2021 18:14:46) ( NTS )
1 Like

Could you try running composer require soberwp/controller to get the latest version of the Sage 9 controller? I believe that should fix the warnings

You might also want to just give Sage 10 a shot if you’re working on a new project!

1 Like

Woop! That got rid of a bunch of them. Left over is:

Deprecated: Method ReflectionParameter::getClass() is deprecated in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php on line 826

Deprecated: Method ReflectionParameter::getClass() is deprecated in /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php on line 900

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-includes/functions.php on line 6712

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-admin/includes/misc.php on line 1310

Warning: Cannot modify header information - headers already sent by (output started at /srv/www/retrogames.cool/current/web/app/themes/retrogames/vendor/illuminate/container/Container.php:826) in /srv/www/retrogames.cool/current/web/wp/wp-admin/admin-header.php on line 9

Can I upgrade to Sage 10 from Sage 9 straight from the project or would I have to “start over”? Thanks!

I’m experiencing the same issue. Trellis default PHP version was set to PHP 8, but installing Sage via composer (as is currently written in the documentation) doesn’t seem to install a version compatible with the most recent version of Trellis.

I will attempt downgrading to PHP 7.4 in group_vars/all/main.yml and provision a new VM to see if this fixes the issue.

Trellis’ PHP version was bumped because PHP 7.4 no longer has active support: https://www.php.net/supported-versions.php

Sage 10 and it’s dependencies are compatible with PHP 8.x, so we’d definitely recommend using that for a new project

1 Like

Thanks for the response, that makes sense.

I was actually updating Trellis for an existing project that uses Sage 9, otherwise would have moved to Sage 10.

There’s a issue with the version of acorn with Sage 10 right now that doesn’t allow it to work with ACF Composer.

What’s that link for? :thinking: ACF Composer issues should be resolved by upgrading to the latest Acorn beta (v2.0.0-beta.7)

Lmao, my bad, meant to postt the GitHub issue thing. All solved though!