Enabling snappdf

I understand the following topic is very old and didn’t want to bump it as it appears the preference is for new topics to be started.

May I make the suggestion that the above is added to the wiki page here? It took me about 40 minutes of searching to figure out why, despite following all of the necessary steps, my instance kept telling me snappdf was not installed or enabled.

Hi,

Sorry for the wasted time!

Not sure I understand, what exactly would you like to see added to the docs?

Thanks for the reply. I figured it out and that matters more to me.

There is nowhere on that page in the documentation, nor in the installation docs, that tell admins that after the .env file is updated on an existing instance, to run php artisan optimise for the change to snappdf to take effect.

That command should no longer be needed, we’ve disabled config caching.

@david if a user manually runs that command once will they need to use it in the future?

Interesting. It wouldn’t work for me until I ran that command. I’d even rebooted the VM and it didn’t do anything until after doing that. Now PDFs are fine on my install.

Do you know if you’ve run the optimise command in the past?

Yes, that is correct. I ran it on my initial installation (about 15 months ago) and then also whenever I do an update via CLI, I need to run that. Otherwise the update won’t take.

One way to test this would be to temporarily change the mailer to log in the .env file (without running optimize) and then use the health check in the app to check the current setting.

@david may be able to provide more info.

Okay, I made the change to log and there is no change in the health check. What should I have seen in there? No, it still says SMTP.

Edit: I also cleared cache and that made no difference.

Hmm… it’s possible the option on Settings > Email Settings is overriding it.

You can also test by changing the PDF generator.

So I set email back to smtp and tested by changing PDF generator to hosted_ninja without running php artisan optimize and as before, there were no changes within the Health Check.

For further testing, I did run php artisan optimize and the changes were enabled and Health Check said that snappdf was not enabled, as expected. I then repeated the steps in reverse. First without optimize and no changes were made. Then followed by optimize and changes were made and then visible in the Health Check.

Thanks, that’s helpful to know!

@david I was under the impression that the config was no longer being cached, is that correct?

@hillel

Correct. Should not be required.

That’s bizarre, because on my install, changes to .env will not take effect until after running that.

Which version of the app are you using?

5.8.53

I didn’t use the desktop app, only web access or mobile.

If you run

php artisan optimize, then future changes will also require re-optimizing…

if you config:clear then the configuration will be read at runtime