XF 2.1 Permissions for community directory

Jon12345

Well-known member
When I installed my forum, I put the permissions for the folder to 0777. I know its not a wise idea to leave them as that, but what should they be set to?
 
In general files and directories should be 0644 and 0755 respectively.

The /data and /internal_data directories should be:
0666/0777 if PHP runs as "nobody" (the web server user)
0644/0755 if it runs as "your" user (suPHP for example)
 
@Brogan after that setup
0644/0755 if it runs as "your" user (suPHP for example)
, I got an error.
My hosting told me that the PHP acting like a user, can you tell me what I can do?
Screenshot_4.webp
Code:
Server error log
League\Flysystem\Exception: Impossible to create the root directory "/home/likepro/public_html/data/avatars/o/0". src/XF/LocalFsAdapter.php:16
Generated by: Bastty Jan 31, 2020 at 8:31 PM
Stack trace
#0 src/vendor/league/flysystem/src/Adapter/Local.php(156): XF\LocalFsAdapter->ensureDirectory('/home/likepro/p...')
#1 src/vendor/league/flysystem/src/Filesystem.php(122): League\Flysystem\Adapter\Local->writeStream('avatars/o/0/1.j...', Resource id #131, Object(League\Flysystem\Config))
#2 [internal function]: League\Flysystem\Filesystem->putStream('avatars/o/0/1.j...', Resource id #131, Object(League\Flysystem\Config))
#3 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array('parent::putStre...', Array)
#4 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod('putStream', Array)
#5 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(71): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall('putStream', Array)
#6 src/vendor/league/flysystem/src/MountManager.php(613): League\Flysystem\EventableFilesystem\EventableFilesystem->putStream('avatars/o/0/1.j...', Resource id #131, Array)
#7 src/XF/Util/File.php(185): League\Flysystem\MountManager->putStream('avatars/o/0/1.j...', Resource id #131, Array)
#8 src/XF/Service/User/Avatar.php(269): XF\Util\File::copyFileToAbstractedPath('/home/likepro/p...', 'data://avatars/...')
#9 src/XF/Pub/Controller/Account.php(466): XF\Service\User\Avatar->updateAvatar()
#10 src/XF/Mvc/Dispatcher.php(350): XF\Pub\Controller\Account->actionAvatar(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(257): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Avatar', Object(XF\Mvc\RouteMatch), Object(DBTech\eCommerce\XF\Pub\Controller\Account), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(DBTech\eCommerce\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#15 src/XF.php(391): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Request state
array(4) {
  ["url"] => string(15) "/account/avatar"
  ["referrer"] => string(27) "https://we-play.pro/forums/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(7) {
    ["avatar_crop_x"] => string(1) "0"
    ["avatar_crop_y"] => string(1) "0"
    ["use_custom"] => string(1) "1"
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(8) "/forums/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 
Back
Top Bottom