Support

Home Forums Event Espresso Premium .htaccess file for /uploads/espresso/logs/ only readable by user

.htaccess file for /uploads/espresso/logs/ only readable by user

Posted: November 19, 2018 at 7:00 am

Viewing 2 reply threads


Ian Just

November 19, 2018 at 7:00 am

It looks like the permissions for the .htaccess file created for example.com/wp-content/uploads/espresso/logs are 0600 or ‘user read/write, everyone else deny’.

While that may work if PHP is running as the webserver’s user, if it’s not, the webserver can’t read the file.

With Apache 2.4 and PHP7-FPM set up to run as the user, you see a

Forbidden

You don't have permission to access /wp-content/uploads/espresso/logs/espresso_log_[long hex string].txt on this server.
Server unable to read htaccess file, denying access to be safe

403 message.

As the contents of the .htaccess file are “deny from all” it’s doing the right thing, but it would be better if the file were created with 0644 permission.


Tony

  • Support Staff

November 19, 2018 at 7:34 am

Hi there,

It looks like the permissions for the .htaccess file created for example.com/wp-content/uploads/espresso/logs are 0600 or ‘user read/write, everyone else deny’.

Event Espresso itself doesn’t set the permissions on the file, WP does.

After a little hoop jumping, EE uses $wp_filesystem->put_contents() to create the .htaccess file.

put_contents() calls its own chmod function which sets the permissions based on the FS_CHMOD_FILE and FS_CHMOD_DIR constants.

Are you overriding those constants within your wp-config.php file?

https://codex.wordpress.org/Editing_wp-config.php#Override_of_default_file_permissions


Ian Just

November 19, 2018 at 8:37 am

No, I’m not. The log files themselves are created 0644.

I’ll see what the constants are set to later.

Viewing 2 reply threads

The support post ‘.htaccess file for /uploads/espresso/logs/ only readable by user’ is closed to new replies.

Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.

Event Espresso