# Acorn issue on shared host

**URL:** <https://discourse.roots.io/t/acorn-issue-on-shared-host/23646>\
**Category:** acorn\
**Created:** [August 1, 2022, 1:30pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646 "2022-08-01T13:30:35Z")\
**Posts on this page:** 18\
**Page:** 1

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 1, 2022, 1:30pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/1 "2022-08-01T13:30:35Z")

</div>

On a shared host I have problems with getting Acorn to work correctly.  
Acorn is installed as a normal plugin. Acorn does create and write to a cache folder on the server and most things work fine.  
However when I try to install a package such as log1x/acf-composer it doesn’t work

I noticed that some things are missing in the Acorn cache folder on the server.  
In the services.php these entries are missing under ‘providers’:

```auto
=> 'Log1x\\AcfComposer\\Providers\\AcfComposerServiceProvider',
=> 'App\\Providers\\ThemeServiceProvider'

```

And packages.php doesn’t contain

`'log1x/acf-composer' and 'roots/sage'`

Some notes:

- I am using Acorn 2.1.2 (the php8 version) on a fresh install with the latest Bedrock/Sage/Bud

- I did add  
`"post-autoload-dump": ["Roots\\Acorn\\ComposerScripts::postAutoloadDump"]`  
to the scripts in Bedrock’s composer.json, but I don’t think it works.

- Locally I had to to run this to get acf-composer to work:

`wp acorn package:discover`

followed by:  
`wp acorn vendor:publish --provider="Log1x\AcfComposer\Providers\AcfComposerServiceProvider"`

Any ideas on how I could get this to work on the server?

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 2, 2022, 10:07am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/2 "2022-08-02T10:07:18Z")

</div>

Maybe I should ask: is there anyone out there who managed to get Sage 10 fully working on a shared host or similar?

And in a broader sense: is Sage 10 (with Blade) a good choice when you are not able to manage the server yourself? Or is that considered an edge case?

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 2, 2022, 11:39am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/3 "2022-08-02T11:39:26Z")

</div>

Maybe related: When I run composer update in the Bedrock root folder (locally) I get this:

```auto
Nothing to install, update or remove
Generating optimized autoload files
Class Roots\Acorn\ComposerScripts is not autoloadable, can not call post-autoload-dump script

```

So adding the ‘autoload’ script to Bedrock’s composer.json doesn’t do anything when you install Acorn as a plugin, as I already suspected.

---

<div class="post-metadata">

**Author:** ![alwaysblank](https://discourse.roots.io/user_avatar/discourse.roots.io/alwaysblank/32/11206_2.png) [@alwaysblank](https://discourse.roots.io/u/alwaysblank)\
**Post date:** [August 2, 2022, 1:46pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/4 "2022-08-02T13:46:06Z")

</div>

> [@cim](#):
>
> Acorn is installed as a normal plugin.

Why did you install it this way if you’re going to use Composer packages anyway?

> [@cim](#):
>
> when I try to install a package such as log1x/acf-composer

How did you install this package?

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 2, 2022, 2:04pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/5 "2022-08-02T14:04:09Z")

</div>

> [@alwaysblank](#):
>
> Why did you install it this way if you’re going to use Composer packages anyway?

I tried that, but couldn’t get it to work on the shared host where cannot run composer install etc. Basically I need something similar to the ‘dist’ we had in Sage 8, where you don’t need to install anything on the server.  
Acorn as a plugin is also recommended for shared hosts I believe.  
I don’t understand why I shouldn’t do that when also using composer packages? I assumed that the Acorn plugin would take care of handling the ACF/block templates created with acf-composer when I upload them, just as it does for the regular blade templates. And as it does locally

> [@alwaysblank](#):
>
> How did you install this package?

`composer require log1x/acf-composer` from my theme folder.  
I move the vendor files to the server. Not ideal I’m sure, but it works for Sage 10 vendor files, and I think this was also recommended in the docs

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 2, 2022, 2:34pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/6 "2022-08-02T14:34:50Z")

</div>

I feel it may also have to do with a similar issue that I found on github, which is related to either acorn or acf-composer.

> <https://github.com/Log1x/acf-composer/issues/109>
>
> Hi,
> Not sure if this question fits here.
> Im trying to use acf composer with sa…ge 10. Installation goes well until i hit wp acorn vendor:publish --provider="Log1x\\AcfComposer\\Providers\\AcfComposerServiceProvider"
> 
> the error i get is this:
> 
> No publishable resources for tag \[\].
> Publishing complete.
> 
> i googled and tried to use the acf.php in config. This doesnt solve it. I also tried wp acorn vendor:publish. This doesnt fix it either.
> 
> I cant use the wp acorn acf:field Example. It wil give me: There are no commands defined in the "acf" namespace. I think this has to do with the publish issue.
> 
> I installed acf in the theme folder.
> 
> I can make the field folder and files manually but i dont get any fields in wordpress.
> 
> Does anyone have a solution for me?
> 
> Thanks!

> <https://github.com/roots/acorn/issues/210>
>
> \### Terms
> 
> \- \[X\] I have read the \[guidelines for Contributing to Roots Project…s\](https://github.com/roots/.github/blob/master/CONTRIBUTING.md)
> \- \[X\] This request is not a duplicate of an existing issue
> \- \[X\] I have read the \[docs\](https://roots.io/docs/) and followed them (if applicable)
> \- \[X\] I have seached the \[Roots Discourse\](https://discourse.roots.io/) for answers and followed them (if applicable)
> \- \[X\] This is not a personal support request that should be posted on the \[Roots Discourse\](https://discourse.roots.io/) community
> 
> \### Description
> 
> \#### What's wrong?
> Sometimes packages cannot be published.
> 
> \#### What have you tried?
> Please see steps below.
> 
> \#### What insights have you gained?
> None.
> 
> \#### Possible solutions
> None I am aware of.
> 
> \#### Temporary workarounds
> Adding the Laravel service provider manually to \`/config/app.php\` will work occasionally. 
> 
> 
> \### Steps To Reproduce
> 
> Add ACF Composer to \`/sage/composer.json\` and update.
> 
> \`\`\`
> "require": {
> "php": "^7.4|^8.0",
> "log1x/acf-composer": "^2.0",
> "roots/acorn": "^2.0.3"
> },
> \`\`\`
> 
> Discover packages:
> \`\`\`
> wp acorn package:discover
> Discovered Package: log1x/acf-composer
> Discovered Package: nesbot/carbon
> Discovered Package: roots/sage
> Package manifest generated successfully.
> \`\`\`
> 
> Publish packages: (ACF Composer not in the list):
> \`\`\`
> wp acorn vendor:publish
> 
> Which provider or tag's files would you like to publish?:
> \[0\] Publish files from all providers and tags listed below
> \[1\] Provider: Roots\\Acorn\\Providers\\AcornServiceProvider
> \[2\] Tag: acorn
> \> 
> \`\`\`
> 
> Checking cache reveals ACF composer entry in array.
> \`/current/web/app/cache/acorn/framework/cache\`:
> 
> \`\`\`
> \<?php return array (
> 'log1x/acf-composer' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Log1x\\\\AcfComposer\\\\Providers\\\\AcfComposerServiceProvider',
> ),
> ),
> \`\`\`
> 
> Other packages can be discovered and published:
> 
> \`\`\`
> "require": {
> "php": "^7.4|^8.0",
> "andreiio/blade-iconoir": "^1.4",
> "blade-ui-kit/blade-heroicons": "^1.3",
> "blade-ui-kit/blade-icons": "^1.2",
> "codeat3/blade-weather-icons": "^1.4",
> "log1x/acf-composer": "^2.0",
> "log1x/navi": "^2.0",
> "log1x/poet": "^2.0",
> "log1x/sage-html-forms": "^1.0",
> "roots/acorn": "^2.0.3"
> },
> \`\`\`
> \`\`\`
> Discovered Package: andreiio/blade-iconoir
> Discovered Package: blade-ui-kit/blade-heroicons
> Discovered Package: blade-ui-kit/blade-icons
> Discovered Package: codeat3/blade-weather-icons
> Discovered Package: log1x/acf-composer
> Discovered Package: log1x/navi
> Discovered Package: log1x/poet
> Discovered Package: log1x/sage-html-forms
> Discovered Package: nesbot/carbon
> Discovered Package: roots/sage
> Package manifest generated successfully.
> \`\`\`
> \`\`\`
> Which provider or tag's files would you like to publish?:
> \[0 \] Publish files from all providers and tags listed below
> \[1 \] Provider: AndreiIonita\\BladeIconoir\\BladeIconoirServiceProvider
> \[2 \] Provider: BladeUI\\Heroicons\\BladeHeroiconsServiceProvider
> \[3 \] Provider: BladeUI\\Icons\\BladeIconsServiceProvider
> \[4 \] Provider: Codeat3\\BladeWeatherIcons\\BladeWeatherIconsServiceProvider
> \[5 \] Provider: Log1x\\Poet\\PoetServiceProvider
> \[6 \] Provider: Roots\\Acorn\\Providers\\AcornServiceProvider
> \[7 \] Tag: acorn
> \[8 \] Tag: blade-heroicons
> \[9 \] Tag: blade-heroicons-config
> \[10\] Tag: blade-iconoir
> \[11\] Tag: blade-icons
> \[12\] Tag: blade-weather-icons-config
> \[13\] Tag: blade-wi
> \[14\] Tag: config
> \> 0
> 
> Copied Directory \[/vendor/andreiio/blade-iconoir/resources/svg\] To \[/public/vendor/blade-iconoir\]
> Copied Directory \[/vendor/blade-ui-kit/blade-heroicons/resources/svg\] To \[/public/vendor/blade-heroicons\]
> Copied Directory \[/vendor/codeat3/blade-weather-icons/resources/svg\] To \[/public/vendor/blade-weather-icons\]
> Publishing complete.
> \`\`\`
> 
> Additional information and users with same problem can be found here:
> https://github.com/Log1x/acf-composer/issues/109
> 
> 
> 
> \### Expected Behavior
> 
> Expecting \`ACF Composer\` to be listed in the set of available packages to publish:
> 
> \`\`\`
> \[0 \] Publish files from all providers and tags listed below
> \[1 \] Provider: AndreiIonita\\BladeIconoir\\BladeIconoirServiceProvider
> \[2 \] Provider: BladeUI\\Heroicons\\BladeHeroiconsServiceProvider
> \[3 \] Provider: BladeUI\\Icons\\BladeIconsServiceProvider
> \[4 \] Provider: Codeat3\\BladeWeatherIcons\\BladeWeatherIconsServiceProvider
> \[5 \] Provider: Log1x\\Poet\\PoetServiceProvider
> \[6 \] Provider: Roots\\Acorn\\Providers\\AcornServiceProvider
> \[7 \] Tag: acorn
> \[8 \] Tag: blade-heroicons
> \[9 \] Tag: blade-heroicons-config
> \[10\] Tag: blade-iconoir
> \[11\] Tag: blade-icons
> \[12\] Tag: blade-weather-icons-config
> \[13\] Tag: blade-wi
> \[14\] Tag: config
> \`\`\`
> 
> \### Actual Behavior
> 
> \`ACF Composer\` package not becoming available.
> 
> Attempting to generate ACF Field, \`wp acorn acf:field Fleet\`
> results in:
> \` There are no commands defined in the "acf" namespace. \`
> 
> After adding and publishing additional packages, ACF Composer is listed in cache but not functioning: 
> 
> \`\`\`
> \<?php return array (
> 'andreiio/blade-iconoir' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'AndreiIonita\\\\BladeIconoir\\\\BladeIconoirServiceProvider',
> ),
> ),
> 'blade-ui-kit/blade-heroicons' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'BladeUI\\\\Heroicons\\\\BladeHeroiconsServiceProvider',
> ),
> ),
> 'blade-ui-kit/blade-icons' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'BladeUI\\\\Icons\\\\BladeIconsServiceProvider',
> ),
> ),
> 'codeat3/blade-weather-icons' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Codeat3\\\\BladeWeatherIcons\\\\BladeWeatherIconsServiceProvider',
> ),
> ),
> 'log1x/acf-composer' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Log1x\\\\AcfComposer\\\\Providers\\\\AcfComposerServiceProvider',
> ),
> ),
> 'log1x/navi' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Log1x\\\\Navi\\\\Providers\\\\NaviServiceProvider',
> ),
> 'aliases' =\> 
> array (
> 'Navi' =\> 'Log1x\\\\Navi\\\\Facades\\\\Navi',
> ),
> ),
> 'log1x/poet' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Log1x\\\\Poet\\\\PoetServiceProvider',
> ),
> ),
> 'log1x/sage-html-forms' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Log1x\\\\HtmlForms\\\\HtmlFormsServiceProvider',
> ),
> ),
> 'nesbot/carbon' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'Carbon\\\\Laravel\\\\ServiceProvider',
> ),
> ),
> 'roots/sage' =\> 
> array (
> 'providers' =\> 
> array (
> 0 =\> 'App\\\\Providers\\\\ThemeServiceProvider',
> ),
> ),
> );
> \`\`\`
> 
> \### Relevant Log Output
> 
> \_No response\_
> 
> \### Versions
> 
> Acorn 2.0.3, Big Sur 11.6.1

Both issues were closed but seem unresolved.

For my situation, if this is just an isolated problem with acf-composer then I’ll just stop using that. I am just worried that I will encounter more problems in the future though.

Hence my more general question whether using modern Bedrock/Sage 10 on a shared host is still a viable/recommended path these days (in principle)? I realize that may be difficult to answer.

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 2, 2022, 7:48pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/7 "2022-08-02T19:48:34Z")

</div>

So I am mostly talking to myself here;) But I am still hoping for some insights. It is kind of crucial for me. I think the 3 questions below are the most important to me:

1. Should I be able to use Bedrock and Sage on a server that I cannot manage? (Acorn as plugin, assets and vendor folders uploaded as recommended in the [docs](https://docs.roots.io/sage/10.x/deployment/#deploying-sage-via-ftp)?
2. Should I be worried that `App\\Providers\\ThemeServiceProvider` is not added to Acorn cache, for instance to the services.php file (on the server)?
3. If I cannot get Acorn to work, would it be bad practice/a bad idea to simply upload the local Acorn cached views to my remote server?

---

<div class="post-metadata">

**Author:** ![alwaysblank](https://discourse.roots.io/user_avatar/discourse.roots.io/alwaysblank/32/11206_2.png) [@alwaysblank](https://discourse.roots.io/u/alwaysblank)\
**Post date:** [August 2, 2022, 10:03pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/8 "2022-08-02T22:03:16Z")

</div>

I can’t really speak to `acf-composer`—@Log1x might be able to explain what’s going on there.

> [@cim](#):
>
> Should I be able to use Bedrock and Sage on a server that I cannot manage? (Acorn as plugin, assets and vendor folders uploaded as recommended in the [docs](https://docs.roots.io/sage/10.x/deployment/#deploying-sage-via-ftp)?

In theory, sure. So far as I know, the docs don’t recommend using Acorn as a plugin, though. In fact doing so is explicitly [not officially supported](https://docs.roots.io/acorn/2.x/installation/#installing-acorn-as-a-plugin):

> Although not officially supported, the following options _should_ work. Please file a [bug report](https://github.com/roots/docs/issues/new?assignees=&labels=&template=bug_report.md) [(opens new window)](https://github.com/roots/docs/issues/new?assignees=&labels=&template=bug_report.md) for future consideration if you run into issues.

> [@cim](#):
>
> I tried that, but couldn’t get it to work on the shared host where cannot run composer install etc.

What do you mean by “couldn’t get it to work”? What failed? What errors did you run into? You shouldn’t need to run `composer install` on your remote host, just run it locally with `--no-dev` and then upload `vendor`. Acorn is, essentially, just a composer package. If you can install other composer packages and they work, Acorn should also work.

> [@cim](#):
>
> Should I be worried that `App\\Providers\\ThemeServiceProvider` is not added to Acorn cache, for instance to the services.php file (on the server)?

The cache is transient; it’s a cache. If something isn’t there that may be a concern, but you aren’t going to be able to reliably fix it by manually uploading something to the cache: If the cache contents are incorrect, either the thing(s) that should be writing to them aren’t working, or they can’t write to the cache directory (i.e. permissions issues). Either of which are the problems you should be looking at.

> [@cim](#):
>
> If I cannot get Acorn to work, would it be bad practice/a bad idea to simply upload the local Acorn cached views to my remote server?

Yes, see above. Even if this “works” it’s not going to work.

---

<div class="post-metadata">

**Author:** ![Log1x](https://discourse.roots.io/user_avatar/discourse.roots.io/log1x/32/5467_2.png) [@Log1x](https://discourse.roots.io/u/Log1x)\
**Post date:** [August 2, 2022, 10:17pm UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/9 "2022-08-02T22:17:34Z")

</div>

> [@cim](#):
>
> I feel it may also have to do with a similar issue that I found on github, which is related to either acorn or acf-composer.

These issues shouldn’t be related. Give what Ben said a try (running `composer install --no-dev` and uploading the `vendor` folder).

If this doesn’t work, try including ACF Composer in the theme instead and doing the same thing as above (running `composer install --no-dev` and uploading the `vendor` folder) and let me know if that works.

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 3, 2022, 7:37am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/10 "2022-08-03T07:37:42Z")

</div>

> [@alwaysblank](#):
>
> In theory, sure. So far as I know, the docs don’t recommend using Acorn as a plugin, though. In fact doing so is explicitly [not officially supported](https://docs.roots.io/acorn/2.x/installation/#installing-acorn-as-a-plugin):

Thanks, yes I mainly read that as ’ it should probably work’ when I originally made the move to Sage 10 (from 8). But it is not as common a use case as it used to be in this community I feel.

> [@alwaysblank](#):
>
> just run it locally with `--no-dev` and then upload `vendor`. Acorn is, essentially, just a composer package. If you can install other composer packages and they work, Acorn should also work.

I tried that, see my answer to log1x which I’ll post in a minute

> [@alwaysblank](#):
>
> If the cache contents are incorrect, either the thing(s) that should be writing to them aren’t working, or they can’t write to the cache directory (i.e. permissions issues). Either of which are the problems you should be looking at.

That’s what I figured too. Acorn is able to write to cache though, so I don’t think it is a permissions problem

> [@alwaysblank](#):
>
> Yes, see above. Even if this “works” it’s not going to work.

I got the idea to sync the cache to the server from a post in [this](https://discourse.roots.io/t/sage-acorn-at-wp-engine/22955/7) thread, so it seemed like a viable approach:

> [@Sage/Acorn At WP Engine](https://discourse.roots.io/t/sage-acorn-at-wp-engine/22955/9):
>
> It also just occurred to me that you could probably get around this issue all together if you precompile your views. Use `wp acorn view:cache` prior to deployment. You might consider checking out other commands that generate PHP cache files, such as for configs and providers. [Acorn 2.x: WP-CLI | Roots Documentation](https://docs.roots.io/acorn/2.x/wp-cli/#available-commands)

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 3, 2022, 7:53am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/11 "2022-08-03T07:53:50Z")

</div>

Thanks Log1x

So let me describe in detail what I did:

**1. Install acf-composer** (from within the theme folder). Deal with ’ No publishable resources’

```auto
$ composer require log1x/acf-composer

$ wp acorn vendor:publish --provider="Log1x\AcfComposer\Providers\AcfComposerServiceProvider"

No publishable resources for tag [].
Publishing complete.

$ wp acorn package:discover

Discovered Package: roots/sage

$ wp acorn vendor:publish --provider="Log1x\AcfComposer\Providers\AcfComposerServiceProvider"

Cannot publish [/app/web/app/themes/my-theme/vendor/log1x/acf-composer/src/Providers/../../config/acf.php] until Acorn is initialized.

 Would you like to initialize Acorn right now? (yes/no) [yes]:

 > yes

Initialized [/app/web/app/themes/my-theme/config]
Copied File [/vendor/log1x/acf-composer/config/acf.php] To [/config/acf.php]
Publishing complete.

```

**2. Create an example field.** After this I can add a field to a post, so all is good locally

`$ wp acorn acf:field Example`

**3. Deployment preparation.** (Note: normally I just upload all the vendor files, or ignore the ones that are dev-only)

```auto
$ composer install --no-dev

Package operations: 0 installs, 0 updates, 2 removals
- Removing squizlabs/php_codesniffer (3.7.1)
- Removing log1x/sage-directives (v1.1.9)
Generating optimized autoload files

```

Leaves me with these vendor folders:

```auto
| vendor
  | bin
  | composer
  | doctrine
  | log1x
    | acf-composer
  | stoutlogic

```

**4. Deployment.** This is my script. Basically just sync everything except for node\_modules, .budfiles and some dev-only files)

```auto
rsync "${optionsSyncRun[@]}" --exclude="*.git*" --exclude="node_modules" --exclude=".budfiles" --exclude=".editorconfig" --exclude="bud.config.*" --exclude="yarn*" --exclude="/*.md" --exclude="/jsconfig.json" --exclude="/tailwind*" --exclude="/package.json" $basePath/$sitePath/$themePath/ $remoteUser@$remoteHost:$remotePath/$themePath/

(where $optionsSyncRun is: -auvih --delete -e ssh --log-file="$logfilePath")

```

After this I have the same results as before. There is no Example field on a new post. Acorn cache has the ‘normal’ views and entries, but misses all entries and views related to a  
`Log1x\\AcfComposer\\Providers\\AcfComposerServiceProvider`  
and `App\\Providers\\ThemeServiceProvider` (see my opening post). The acorn log folder is empty by the way.

---

<div class="post-metadata">

**Author:** ![Log1x](https://discourse.roots.io/user_avatar/discourse.roots.io/log1x/32/5467_2.png) [@Log1x](https://discourse.roots.io/u/Log1x)\
**Post date:** [August 3, 2022, 8:09am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/12 "2022-08-03T08:09:29Z")

</div>

Very confusing.

For now, can you try manually adding the provider `Log1x\AcfComposer\Providers\AcfComposerServiceProvider::class` to `providers` in `config/app.php` and see if that works?

Also make sure you’re requiring sage-directives in as non-dev. It looks like it removed it when you ran `composer install --no-dev`

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 3, 2022, 8:33am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/13 "2022-08-03T08:33:36Z")

</div>

> [@Log1x](#):
>
> `Log1x\AcfComposer\Providers\AcfComposerServiceProvider::class`

Like so?

```auto
    'defaults' => [
        'trueFalse' => ['ui' => 1],
        'select' => ['ui' => 1],
    ],
    'providers' => [
        'Log1x\AcfComposer\Providers\AcfComposerServiceProvider::class'
    ]

```

It doesn’t make a difference unfortunately.

> [@Log1x](#):
>
> Also make sure you’re requiring sage-directives in as non-dev. It looks like it removed it when you ran `composer install --no-dev`

Thanks, good to know. I added it is a non-dev now.

---

<div class="post-metadata">

**Author:** ![Log1x](https://discourse.roots.io/user_avatar/discourse.roots.io/log1x/32/5467_2.png) [@Log1x](https://discourse.roots.io/u/Log1x)\
**Post date:** [August 3, 2022, 8:51am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/14 "2022-08-03T08:51:57Z")

</div>

No, undo the change to `acf.php` – it doesn’t need touched.

Copy [config/app.php](https://github.com/roots/acorn/blob/40c4f0ec99e6caa988238e72c409adedb1ebf700/config/app.php) to your config folder and add the provider [here](https://github.com/roots/acorn/blob/40c4f0ec99e6caa988238e72c409adedb1ebf700/config/app.php#L171)

Alternatively you can dump all of Acorn’s configs by doing `wp acorn vendor:publish` and choosing the Acorn service provider – but that shouldn’t be necessary in this case and I’d try the above first.

You mentioned logging not working, if you want to enable logging, you need to dump or bring over [`logging.php`](https://github.com/roots/acorn/blob/40c4f0ec99e6caa988238e72c409adedb1ebf700/config/logging.php#L20) and change the default log channel from `null` to `stack`.

---

<div class="post-metadata">

**Author:** ![Log1x](https://discourse.roots.io/user_avatar/discourse.roots.io/log1x/32/5467_2.png) [@Log1x](https://discourse.roots.io/u/Log1x)\
**Post date:** [August 3, 2022, 9:12am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/15 "2022-08-03T09:12:32Z")

</div>

Sorry, I linked configs from the wrong Acorn branch.

You’ll want [this](https://github.com/roots/acorn/blob/82649f7b8b4916da7fb63b202b4e3c8024178dbd/config/app.php) `app.php`.

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 3, 2022, 9:22am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/16 "2022-08-03T09:22:20Z")

</div>

> [@Log1x](#):
>
> Copy [config/app.php](https://github.com/roots/acorn/blob/40c4f0ec99e6caa988238e72c409adedb1ebf700/config/app.php) to your config folder and add the provider [here](https://github.com/roots/acorn/blob/40c4f0ec99e6caa988238e72c409adedb1ebf700/config/app.php#L167)

Sorry about that! I put the app.php to the config folder and added the provider. I also copied the logging.php file to the config folder and changed null to stack  
`'default' => env('LOG_CHANNEL', 'stack'),`

The app.php you linked to gave me a lot of errors, so I used this one instead:  
[https://github.com/roots/acorn/blob/82649f7b8b4916da7fb63b202b4e3c8024178dbd/config/app.php](https://github.com/roots/acorn/blob/82649f7b8b4916da7fb63b202b4e3c8024178dbd/config/app.php). Edit: I see your update now

Now we are getting somewhere! I can add fields now on the server. Cached views for the fields are generated. (The entries for acf-composer in services.php and packages.php are still missing)

---

<div class="post-metadata">

**Author:** ![Log1x](https://discourse.roots.io/user_avatar/discourse.roots.io/log1x/32/5467_2.png) [@Log1x](https://discourse.roots.io/u/Log1x)\
**Post date:** [August 3, 2022, 9:38am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/17 "2022-08-03T09:38:10Z")

</div>

> [@cim](#):
>
> (The entries for acf-composer in services.php and packages.php are still missing)

You don’t need to worry about this now that it’s added to `app.php` – `services.php` and `packages.php` deal with package discovery which for some reason isn’t picking up ACF Composer in your server’s environment.

Nonetheless, you should be good to go. If you add more packages down the road, you will probably have to add them to `app.php` still but there’s no negative side to doing this.

---

<div class="post-metadata">

**Author:** ![cim](https://discourse.roots.io/user_avatar/discourse.roots.io/cim/32/10827_2.png) [@cim](https://discourse.roots.io/u/cim)\
**Post date:** [August 3, 2022, 10:10am UTC](https://discourse.roots.io/t/acorn-issue-on-shared-host/23646/18 "2022-08-03T10:10:35Z")

</div>

That is great news.

I went on and installed your package `sage-svg`.

Again I had to run `wp acorn package:discover` before I could publish the config file. But this time it seems to work fine on the server without adding the provider to `config/app.php`

Anyway if this is a viable workaround I am very happy.

So in summary the workaround to get `acf/composer` (and probably some other packages) to work when you use Acorn as a plugin:

1. Install the package in your theme folder

2. Publish (If needed use `wp acorn package:discover`)

3. Upload everything to server except node\_modules, .budfiles, dev-only vendors and dev-only files (you may want to run `composer install --no-dev` first)

4. Copy the `app.php` from the Acorn version you are using to `my-theme/config/`

5. Manually add the provider

6. Upload again

edit: I assume it is also a good idea to add the `App\\Providers\\ThemeServiceProvider` in the same way, in case you want to register any application services in `ThemeServiceProvider.php`.
