Closed zengenuity closed 4 years ago
I should have mentioned this is on LocalFileSystem driver.
@zengenuity Is the execution account of php (Web server) UID 2000? chmod can only be a file whose owner is php (Web server).
Thanks for your help with this.
Yes, UID 2000 is a user account "dev". Some debugging output from the command line:
Dev is UID 2000:
dev@studentdru1:~/data$ id
uid=2000(dev) gid=2000(dev) groups=2000(dev)
Dev owns the file and has write access.
dev@studentdru1:~/data$ ls -l
total 0
-rw-r--r-- 1 dev dev 0 Dec 31 18:01 NewFile.php
PHP is running as mod-php on Apache. Apache is running as user dev:
dev@studentdru1:~/data$ ps ax
PID USER TIME COMMAND
...
1935 dev 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start
1936 dev 0:00 /usr/sbin/httpd -d /var/www -f /etc/apache2/httpd.conf -k start
The file NewFile.php was actually created using elFinder, and it was created owned by dev, so that matches with the web server user.
Dev user can run chmod on the command line, and it works:
dev@studentdru1:~/data$ ls -l
total 0
-rw-r--r-- 1 dev dev 0 Dec 31 18:01 NewFile.php
dev@studentdru1:~/data$ chmod 755 NewFile.php
dev@studentdru1:~/data$ ls -l
total 0
-rwxr-xr-x 1 dev dev 0 Dec 31 18:01 NewFile.php
dev@studentdru1:~/data$
Anything else I should check?
elFinder use posix_getuid()
to get PHP uid. What is result next test code on your web server?
<?php
var_dump(posix_getuid());
Ugh. Sorry. php-posix module was not installed.
I thought it was because --enable-posix=shared
was on the configure command info in phpinfo(). But, apparently on Alpine Linux, you also need to have php7-posix package installed. After I install, it works.
Thanks again for your help debugging this.
I can't figure out why the chmod button is always disabled for me. I have enabled the button, but when I select a file, it's always greyed-out, as shown here.
I have enabled the chmod command in my connector config by adding:
That makes the button show up, but it's always disabled. The statOwner function is working, and I have the permission shown in Get Info.
I must be missing a step. Any ideas?