ACF builder error on server side

Hi, I’m getting a PHP error only on server side. Is just Sage 9 (no Trellis/Bedrock this time).

It seems that class FieldsBuilder was not found, despite use StoutLogic\AcfBuilder\FieldsBuilder at the top of the file.

This is the complete warning (note in #7 that line 16 of /app/fields/options.php is causing the error)

**Fatal error** : Uncaught Error: Class 'StoutLogic\AcfBuilder\FieldsBuilder' not found in /var/www/vhosts/ 

Stack trace: 

#0 /var/www/vhosts/ require_once() 

#1 [internal function]: App\{closure}('/var/www/vhosts...', 0)

#2 /var/www/vhosts/ array_map(Object(Closure), Array, Array)

#3 /var/www/vhosts/ Illuminate\Support\Collection->map(Object(Closure))

#4 /var/www/vhosts/ App\{closure}('')

#5 /var/www/vhosts/ WP_Hook->apply_filters(NULL, Array)

#6 /var/www/vhosts/ WP_Hook->do_action(Array) 

#7 /var/www/vhosts/ do_action('ini in **/var/www/vhosts/** on line **16**

So, the new object constructor doesn’t find the class. This is the line in context:

What could be the cause of the error? Why does it happen only on the server side? (the theme is identical locally and on the server).

I have no much PHP skills. Any help appreciated!

Hey @aitor,

I’m getting an access denied error on the bitbucket link you shared.

The first thing that comes to mind if it’s working on your local dev setup but not your server is that you may not have the composer dependencies (including acf-builder) installed on the server. Have you run composer install --no-dev on the server or uploaded your vendor folder?

1 Like

Hi Matt. I’ll go to check it (including repo access). Thanks!

Vendor was git ignored! Thank you for your time, @mmirus. All works now.

1 Like

This topic was automatically closed after 42 days. New replies are no longer allowed.