XF 2.2 paths must be writable: js, src/addons, styles, src/XF/Repository/AddOn.php.

CtrlV

Active member
After I transfer from apache to nginx, and using php 8.1. I cannot install add on it says

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.

I've done Chmod or chown but still not working

Any help from devs?
 

Attachments

  • Screenshot_4.webp
    Screenshot_4.webp
    106 KB · Views: 9
Simply make sure your directories meet the read/write requirements as outlined.
You are not allowing your HTTP user (usually nginx) read/write access to the necessary directories.

In addition to that, you need to make SURE that your root directory has read/write access for whatever user nginx/php-fpm is running as.
 
I tried also restart nginx, rebuild cache. but no luck
Until you make sure your chmod/chown settings are correct.. you are going to have issues.
Is this a "self-rolled" system, or are you by chance using the excellent CentMin mod?
Typically www-data is apache specific.. not nginx. Usually using nginx relates to the nginx:nginx user/group setting.
 
Until you make sure your chmod/chown settings are correct.. you are going to have issues.
Is this a "self-rolled" system, or are you by chance using the excellent CentMin mod?
Typically www-data is apache specific.. not nginx. Usually using nginx relates to the nginx:nginx user/group setting.
I just tried that www-data as chatgpt suggest but not successful. I change to root now. I installed plain Ubuntu, Nginx, MariaDb, Php8.1
 

Attachments

  • Screenshot_5.webp
    Screenshot_5.webp
    94.1 KB · Views: 3
I just tried that www-data as chatgpt suggest but not successful. I change to root now. I installed plain Ubuntu, Nginx, MariaDb, Php8.1
you need to check what users PHP-FPM and NGINX are running as... and make sure at least nginx user has read/write ability to the necessary directories. What you are seeing is VERY typical of permission issues.
It is one reason that I don't recommend, unless you are Linux admin proficient, that you "roll your own". Even with the fact that CentOS expires in about 7 months, going with CentMin Mod is a much easier proposition.
Sometimes installs run nginx/php-fpm under the WWW user.... have you used PS to check what user nginx and php-fpm is running under?
The problem with following a lot of the "guides" you find on the interwebz is that they aren't complete.
 
you need to check what users PHP-FPM and NGINX are running as... and make sure at least nginx user has read/write ability to the necessary directories. What you are seeing is VERY typical of permission issues.
It is one reason that I don't recommend, unless you are Linux admin proficient, that you "roll your own". Even with the fact that CentOS expires in about 7 months, going with CentMin Mod is a much easier proposition.
Sometimes installs run nginx/php-fpm under the WWW user.... have you used PS to check what user nginx and php-fpm is running under?
The problem with following a lot of the "guides" you find on the interwebz is that they aren't complete.
Thanks for your reply

heres my
Code:
ps aux | grep php-fpm | grep -v grep
Code:
root         619  0.0  0.1 225288 29292 ?        Ss   09:45   0:00 php-fpm: master process (/etc/php/8.1/fpm/php-fpm.conf)
www-data    1538  2.8  0.4 383400 78208 ?        S    10:39   1:34 php-fpm: pool www
www-data    1552  3.0  0.4 532220 79100 ?        S    10:44   1:31 php-fpm: pool www
www-data    1986  1.3  0.4 380500 66120 ?        S    11:28   0:05 php-fpm: pool www

I tried using root and www-data but both not working. I dont see nginx user
 
I tried using root and www-data but both not working. I dont see nginx user
You need to check your ngiinx config also and see what user it is running under.
user nginx nginx;
and then check your php-fpm user.
I'm, pretty sure that actually you need to grant read/write access to the nginx user.. but not knowing how you set your system up I cannot guarantee that.
 
Thanks for reply, we are almost there, heres nginx.conf


Code:
user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        types_hash_max_size 2048;
        # server_tokens off;

        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;

        include /etc/nginx/mime.types;
        default_type application/octet-stream;

        ##
        # SSL Settings
        ##

        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;

        ##
        # Logging Settings
        ##

        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        ##
        # Gzip Settings
        ##

        gzip on;

        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

        ##
        # Virtual Host Configs
        ##

        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
}


#mail {
#       # See sample authentication script at:
#       # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
#       # auth_http localhost/auth.php;
#       # pop3_capabilities "TOP" "USER";
#       # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
#    server {
#        listen 25;
#        protocol smtp;
#    }
#
#       server {
#               listen     localhost:110;
#               protocol   pop3;
#               proxy      on;
#       }
#
#       server {
#               listen     localhost:143;
#               protocol   imap;
#               proxy      on;
#       }
#}

mail {
    server_name mail.***.com;
    auth_http localhost/auth.php;

    proxy on;
    proxy_pass_error_message on;

    ssl_prefer_server_ciphers on;

    # Set up SSL/TLS for the mail proxy
   # ssl_certificate /etc/nginx/certs/server.crt;
    #ssl_certificate_key /etc/nginx/certs/server.key;
    ssl_certificate /etc/letsencrypt/live/mail.****.com/fullchain.pem;
    ssl_certificate /etc/letsencrypt/live/mail.****.com/privkey.pem;


    smtp_auth login plain;
    imap_capabilities "IMAP4rev1" "UIDPLUS";

    server {
        listen 25;
        protocol smtp;
    }

    server {
        listen 110;
        protocol pop3;
    }

    server {
        listen 143;
        protocol imap;
    }
}


no nginx here, should i try to create?
 
no nginx here, should i try to create?
no, but somewhere int the guide you used it had to set the nginxuser... and there are so many guides out there (and many of them with issues) that I can't tell you exactly where to look. What you are looking at appear to be the vhost config... not the actual nginx config which usually sets the nginx user and not a vhost setting.
 
nginx is running as user www-data and the PHP FPM pool (according to ps) as well.

In this case (and only in this case! Normally I'd reommend to run the pool under its own user) user www-data does need rwx on the mentioned directories.
Thanks for helping, I chown and chmod to www-data as ls -l shown below:


Code:
-rw-r--r--  1        1003        1005   302 Oct 21  2020 admin.php
-rw-r--r--  1        1003        1005   238 May 13 04:09 ads.txt
drwxr-xr-x  2        1003        1005  4096 Jun 25  2020 cgi-bin
-rw-r--r--  1 root        root        13051 Aug 16 09:36 check.php
-rw-r--r--  1        1003        1005   324 Oct 21  2020 cmd.php
-rw-r--r--  1        1003        1005  1918 Oct 21  2020 connected_account.php
-rw-r--r--  1        1003        1005   813 Jul  7  2019 css.php
drwxrwxrwx 10 root        root         4096 Feb  9  2023 data
-rw-r--r--  1        1003        1005   820 Sep 11  2019 externalsite.php
-rw-r--r--  1        1003        1005  1172 Dec 31  2020 htaccess.txt
-rw-r--r--  1        1003        1005    49 Aug  1  2019 index2.php
-rw-r--r--  1        1003        1005   377 Oct 21  2020 index.php
drwxr-xr-x  2        1003        1005  4096 Jul  7  2019 install
drwxrwxrwx 11        1003        1005  4096 Jul 19  2022 internal_data
-rw-r--r--  1        1003        1005  1328 Oct 21  2020 job.php
drwxrwxrwx 23 www-data    www-data     4096 Aug 14 02:04 js
-rw-r--r--  1        1003        1005  1136 Jan 12  2020 klEMProxy.php
drwxr-xr-x  2        1003        1005  4096 Mar 11  2020 library
-rw-r--r--  1        1003        1005  1045 Sep 24  2018 lwHostsCheck.php
-rw-r--r--  1        1003        1005   863 Jul  7  2019 oembed.php
-rw-r--r--  1 root        root         1806 Apr 17 09:56 ORIGhtaccessNoAds.txt
-rw-r--r--  1 root        root        41316 Dec 31  2020 out
drwxrwxr-x  3 elasticuser elasticuser  4096 Dec 30  2020 parallel-20201222
-rw-r--r--  1        1003        1005  1688 Dec 11  2021 payment_callback.php
-rw-r--r--  1 root        root           23 Aug 14 05:34 phpinfo.php
-rw-r--r--  1        1003        1005   620 Aug 14 05:40 php.ini
-rw-r--r--  1        1003        1005   983 Jul  7  2019 proxy.php
drwxr-x---  2        1003          99  4096 Aug 14 04:07 public_html
-rw-r--r--  1        1003        1005   309 Apr 17 10:22 robots.txt
-rw-r--r--  1        1003        1005  6028 May 19  2021 service_worker.js
-rw-r--r--  1        1003        1005   376 Jul  7  2019 sitemap.php
drwxrwxrwx  6 www-data    www-data     4096 Nov 30  2020 src
drwxrwxrwx  8 www-data    www-data     4096 Feb  8  2023 styles
-rw-r--r--  1        1003        1005  7935 Dec  5  2020 sucuri-1320a6bedd56df82ab7a19a36f75ad99.php
-rw-r--r--  1        1003        1005   203 Dec 31  2020 test.php
drwxr-xr-x  2 root        root         4096 Aug 14 04:25 tmp
-rw-r--r--  1        1003        1005  1873 Sep 22  2021 unfurl.php
lrwxrwxrwx  1 root        root           21 Aug 14 02:34 virad -> /usr/share/phpmyadmin
lrwxrwxrwx  1 root        root           21 Aug 14 05:00 viradmin -> /usr/share/phpmyadmin
-rw-r--r--  1        1003        1005   357 Oct 21  2020 webmanifest.php
-rw-r--r--  1        1003        1005   596 Jul  7  2019 XF2-INSTALL-UPGRADE.txt

restart nginx then rebuild cache but still no progress
 
Top Bottom