All add-ons currently require PHP 7.4 or greater.

On July 4th 2024 PHP 8.2 will be the new minimum requirement for all add-ons. Expect any add-on released after that date to require 8.2 or greater. Some releases may not immediately take advantage of 8.x specific features in PHP, which means you might, be able to continue using new releases in PHP 7.4, however, if you experience an error the first thing you should do is update to PHP 8.2 then create a support ticket if the error persists.

Publisher does not support the Fluid field type. Please do not contact asking when support will be available.

If you purchased an add-on from expressionengine.com, be sure to visit boldminded.com/claim to add the license to your account here on boldminded.com.

Ticket: Not Reading .env Variables

Status Resolved
Add-on / Version Speedy 1.9.1
Severity
EE Version 7.4.6

Doug Black

May 23, 2024

Description of the problem

When trying to activate Speedy static caching, I am getting an error where database variables are not defined. These are all defined in the config and pulled in via the .env.php.

This happens when using the static caching with either local files or redis.

How To Reproduce

Steps to reproduce the behavior:

  1. Set up Speedy static caching in templates.
  2. Enable in nginx config.

Error Messages


There was a database connection error or a problem with a query. Log in as a super admin or enable debugging for more information.

Environment Details: - Version: 7.4.6 - PHP Version 8.0.x - MySQL Version 8.0 - OS: Ubuntu - Web Server: nginx

#1

BoldMinded (Brian)

Try downloading the latest version, there was a fix specifically for this in it.

#2

Doug Black

I have 1.9.1 which is the latest one in the EE store. Is there a newer version?

#3

BoldMinded (Brian)

Yep, 1.9.2, which I apparently forgot to upload to ee.com. Should be there now.

#4

Doug Black

Thanks. I updated to the newest version, but am still experiencing the same thing. Do I need to regenerate the Redis index?

#5

BoldMinded (Brian)

Yes, clear your cache, delete the utilities folder, and re-generate the files.

#6

Doug Black

Perfection. Thank you!

We’re using nginx with redis caching on this. The docs only mention htaccess rules to rewrite. If someone needs the nginx rules, here’s what we implemented (not ideal, but will work LOL):

if (-f $document_root/index_redis_default_site.php) {
    set $do_rewrite 1;
}

if ($request_uri ~ ^/admin.php) {
    set $do_rewrite 0;
}

if ($query_string ~* (ACT|URL)) {
    set $do_rewrite 0;
}

if ($request_method = POST) {
    set $do_rewrite 0;
}

if ($request_uri ~ ^/~) {
    set $do_rewrite 0;
}

if ($request_uri ~* \.(css|js|gif|jpe?g|png)$) {
    set $do_rewrite 0;
}

if (-f $request_filename) {
    set $do_rewrite 0;
}

if ($do_rewrite) {
    rewrite ^(.*)$ /index_redis_default_site.php?$request_uri last;
}
#7

Doug Black

Wait, spoke too soon.

I’m getting inconsistent delivery. Sometimes it’s showing the site, sometimes a database credential error screen.

#8

BoldMinded (Brian)

I’m not sure how to help with that. Could be a Nginx config issue, a Redis issue, or any number of other things. Are you able to provide any additional info?

#9

BoldMinded (Brian)

Doug, did this get resolved or are you able to provide additional info?

#10

Doug Black

Thanks Brian, I forgot to respond on here. It was a PHP thing, wasn’t restarting PHP and memcached and opcache and all that.

Thanks for your help!

Login to reply