XF 2.1 Add-ons throw file permission error.

Hi, I have tried to access the "install/upgrade from archive" in Add-ons but with no luck. After hours of struggeling with changing permissions on the files it still throws the same error. I am running xenforo on a nginx server but have my doubts that is the reason it fails. I have searched for hours to fix this problem and have found nothing.

I have run these commands to try to fix the issue with no luck.

Bash:
chmod 0755 js
chmod 0755 src/addons
chmod 0755 styles
chmod 0644 src/XF/Repository/AddOn.php

The error i get is: Cannot install from archive as not all required directories are writable. Various directories must be writable by the web server user to install from an archive. In addition to the XF root directory, some or all of the following paths must be writable: js, src/addons, styles, src/XF/Repository/AddOn.php.

Kind regard's
- BlackFalcon
 
pretty much simply by (usually) assuring that your HTTP process has read/write access to ALL directories in from your root location.
Hmm, I wouldn't give such an advice as that is IMHO a bad idea:

Normally, the webserver process doesn't need (nor should have) write access anywhere within XenForo root - unless a SAPI is used where PHP is run within the webserver process (eg. mod_php, probably also LSAPI).

Read access should also be restricted to those files and directories where the webserver needs to read resources, eg. data, styles, js.
In a standard configuration, the webserver process doesn't need to read any files within src or internal_data (unless an Add-on is used to make use of sendfile, in this case the webserver process does need read access).

Especially giving the webserver process read access to src can be dangerous - imagine the webserver process reading src/config.php and sending its content to the client (maybe due to a misconfiguration or a bug) :eek:
 
Last edited:
Top Bottom