Can't install, directories and files are not writable, even though they are

Started by DisketteGuy, July 06, 2025, 08:05:45 PM

Previous topic - Next topic

DisketteGuy

I'm stuck with this procedure:
Checking files are writable
Some files need to be writable for SMF to work properly.

    attachments
    avatars
    custom_avatar
    cache
    Packages
    Smileys
    Themes
    agreement.txt
    Settings.php
    Settings_bak.php
    cache/db_last_error.php

Even though the files and directories are definitely writable.
Here's the ls -alh
sh-5.2# ls -alh
total 290K
drwxr-xr-x 10 http http   25 Jun 27 20:07 .
drwxr-xr-x  6 http http    7 Jul  6 15:10 ..
-rw-r--r--  1 http http 1.6K May 25 20:01 LICENSE
drwxrwxrwx  3 http http    5 Jun 27 20:07 Packages
-rw-r--r--  1 http http  96K Jun 26 15:05 SSI.php
-rw-rw-rw-  1 http http 6.5K Jun 26 15:05 Settings.php
-rw-rw-rw-  1 http http 6.6K Jun 26 15:05 Settings_bak.php
drwxrwxrwx  4 http http    5 Jul  6 15:05 Smileys
drwxr-xr-x  8 http http  130 Jun 27 20:07 Sources
drwxrwxrwx  3 http http    4 Jun 27 20:07 Themes
-rw-rw-rw-  1 http http 3.3K Apr 27  2023 agreement.txt
drwxrwxrwx  2 http http    4 Jun 27 20:07 attachments
drwxrwxrwx  3 http http    6 Jun 27 20:07 avatars
drwxrwxrwx  2 http http    5 Jul  6 15:32 cache
-rw-r--r--  1 http http  13K Jun 26 15:05 cron.php
drwxrwxrwx  2 http http    4 Jun 27 20:07 custom_avatar
-rw-r--r--  1 http http  16K Jun 26 15:05 index.php
-rw-r--r--  1 http http  77K Jun 26 15:05 install.php
-rw-r--r--  1 http http  70K May 25 20:01 install_2-1_mysql.sql
-rw-r--r--  1 http http  83K May 25 20:01 install_2-1_postgresql.sql
-rw-r--r--  1 http http 8.6K Jun 26 15:05 proxy.php
-rw-r--r--  1 http http  33K Apr 27  2023 readme.html
-rw-r--r--  1 http http  28K Apr 27  2023 ssi_examples.php
-rw-r--r--  1 http http 5.6K Apr 27  2023 ssi_examples.shtml
-rw-r--r--  1 http http  10K Apr 27  2023 subscriptions.php
sh-5.2#

nginx configuration user is set to user http http;
And the ultimate test, I gave an http user shell access that I removed right after... I can touch the and create a file inside those directories just fine, so I have no idea what's the problem is...

I literally have no idea what's wrong with my system, and why I cannot proceed to install. MediaWiki installed fine on this system. Not SMF and phpBB though.

Illori

is cache/db_last_error.php writable? it is not visible in your list.

GL700Wing

@DisketteGuy  Having the file/directory write permission for 'other' enabled can cause software installation issues and, because this permission effectively means that literally 'anyone/everyone' can modify, delete, overwrite these files/directories, some shared hosting providers block access to these files/directories due to the associated potential security risks.
Life doesn't have to be perfect to be wonderful ...

Slava
Ukraini!
"Before you allow people access to your forum, especially in an administrative position, you must be aware that that person can seriously damage your forum. Therefore, you should only allow people that you trust, implicitly, to have such access." -Douglas

DisketteGuy

Quote from: GL700Wing on July 06, 2025, 08:56:22 PM@DisketteGuy  Having the file/directory write permission for 'other' enabled can cause software installation issues and, because this permission effectively means that literally 'anyone/everyone' can modify, delete, overwrite these files/directories, some shared hosting providers block access to these files/directories due to the associated potential security risks.

I am my own hosting provider. I own this system. But it still does not answer my implied question of "why is it not working?".
777 should be "good" enough for the installation, since literally anyone, from random user to root can do anything with it.

DisketteGuy

Quote from: Illori on July 06, 2025, 08:33:44 PMis cache/db_last_error.php writable? it is not visible in your list.

Yep, it has rwxrwxrwx, anyone from the system can read, write and... execute that file for whatever reason.

Kindred

777 is generally not needed

755 for directories -- maybe 775 if that doesn't work on your host.
644 for files -- maybe 664 if that doesn't work on your host.

Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

vbgamer45

Also check if SELinux  is enabled or not. If enabled you have to give a different set of permissions for apache etc.
Community Suite for SMF - Grow your forum with SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com - Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

DisketteGuy

Quote from: vbgamer45 on July 07, 2025, 09:08:11 AMAlso check if SELinux  is enabled or not. If enabled you have to give a different set of permissions for apache etc.

SELinux is not active. AppArmor is also not active. Anything that could be the problem with ACLs access is not active.

Strangely, MediaWiki is installed at /usr/share/webapps/w/ and it runs fine, I can even upload images to it.
SMF is installed at /usr/share/webapps/smf/, anyone can access the /webapps/ directory and it has 764 permission.

I still have no idea what's wrong. This has been happening since I tried installing phpBB, but not MediaWiki for some reason.

DisketteGuy

Quote from: Kindred on July 07, 2025, 08:14:09 AM777 is generally not needed

755 for directories -- maybe 775 if that doesn't work on your host.
644 for files -- maybe 664 if that doesn't work on your host.



Well, the tarball seemed to be pre-emptively set to those permission anyway. And it still did not work.

I set it to 777 because if [an ambiguious user/group] is not authorized to read/write due to permission issue, then setting it to 777 should fix it. But it does not. Too bad for me.

DisketteGuy

SOLVED

Never mind, php-fpm systemd service were not meant to write into /usr directories.
Either move it somewhere that's not inside /usr
or comment out ProtectSystem=full at /usr/lib/systemd/system/php-fpm.service

Although, it is weird that MediaWiki can write into /usr using magic.

Advertisement: