Jump to content
totoff

Absolute newbies asking about file permissions

Recommended Posts

hello forum,

i'm an absolute newbie to pw who has worked (and still works) with textpattern and contao. i have a firm grasp of html, css and some of jquery but very little of php (not to say nothing at all 8) ).

i came across processwire and it looks very, very promising to me. i installed locally on xammp. however, immediately i'm having my first questions. pleas apologize, if this are silly questions from a pro's point of view:

- on finishing the installation i got the following message:

Now that the installer is complete, it is highly recommended that you make ./site/config.php non-writable!

but how do i do that? does that refer to the permissions my ftp user has? and what would be the right permission (0000)?

- within /site/config.php i found the following comment:

/**

* chmodDir: octal string permissions assigned to directories created by ProcessWire

*

*/

$config->chmodDir = "0777";

does that mean, all directories processwire will creates will have assigned 0777 permissions? this doesn't matter to me on localhost, but live, in a shared hosting environment, this seems to be a high risk. if so, is that really necessary or can it be overcome somehow?

thanks for answering and for your time!

totoff

Share this post


Link to post
Share on other sites

Hi totoff

Is this XAMPP for Windows? If so then you can open that folder, right-click on the file, click on "Properties" and change the permissions to read only in the dialogue box that pops up, then click save.

Otherwise you would need to set it to 0644 usually (so that the the program can read from and write to it, but nobody outside the server can). In fact, since it doesn't get changed except manually after that, you could perhaps set it to 0600.

As for the chmodDir setting - is that enabled by default? I seem to remember it was commented out by default at one stage, however if it's enabled, you can change it to 0755 and that should be fine I would think.

It's also worth noting that this setting for folders only applies to folders that PW creates to store files for file or image fields for pages you create, not the whole system.

Share this post


Link to post
Share on other sites

many thanks for this quick reply pete!

Is this XAMPP for Windows?

it is, but i was concerned about what to do when on a live server. your reply

Otherwise you would need to set it to 0644 usually
has clarified that.
As for the chmodDir setting - is that enabled by default?
. yes, it is. i'll go with 755 than on a live server, thanks.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By jploch
      Hey folks,
      Iam working on a module that extends InputfieldPageTable. I use PageTableExtended as a starting point and all went well so far, except I can't access my config values outside of the module file. The config values allways return the defaults, and not the values in the pw field settings. 

      Here is the code that sets the defaults inside my inputfield module file:
      public function init() { parent::init(); // defaults $this->set('gridMaxWidth', '1600'); $this->set('gridColumns', '12'); } Here is how I add the config field:
      public function ___getConfigInputfields() { $inputfields = parent::___getConfigInputfields(); $fieldsetGrid = $this->modules->get('InputfieldFieldset'); $fieldsetGrid->label = $this->_('Default Grid Settings'); $f = $this->wire('modules')->get('InputfieldText'); $f->attr('name', 'gridMaxWidth'); $f->attr('value', $this->gridMaxWidth); $f->label = $this->_('Container max width'); $f->description = $this->_('Grid container max width in px'); // page name format description $f->notes = $this->_('default is 1600'); // page name format notes $fieldsetGrid->append($f); $inputfields->append($fieldsetGrid); return $inputfields; } Accessing the values outside my module files like this (this gives me the default: 1600, even if I insert another value in the backend field settings):
      $default = $this->wire('modules')->get('InputfieldPageGrid'); $default->gridMaxWidth; Any Ideas?
    • By jonatan
      "Permission “page-sort” for template “ ... ” not allowed (requires “page-edit” permission)"

      – This lovely error message is thrown at me, if, as implied by it, I try to add (to my "editor" role) the permission "page-sort" for a specific template, without the permission "page-edit" enabled for the same template.
      Seems like it's been mentioned a few times before but never properly answered, by e.g. @Robin S ... :  
      "Allow the granting of page-sort permission independent of page-edit": https://github.com/processwire/processwire-requests/issues/29
       
       
       


      Why do I wanna do this?:

      I have a page tree structure  🌳  as so:

      ________________________

      Category [C1]
      – Page a [C1_p] – Page b [C1_p] Different category [C2]
      – Page c [C2_p] – Page d [C2_p] ________________________

      The page "Category" has the page-template "C1",
      the pages "Page a" and "Page b" both have the page-template "C1_p".
      The page "Different category" has the page-template "C2"
      the pages "Page c" and "Page d" both have the page-template "C2_p".
       
      The two pages called "Category" and "Different category" do not have any content, they only serve as containers for pages belonging to that category.
       
      I want my "editor" role not to be able to do anything at all with these pages "Category" and "Different category"; i.e. I do not want my editor to be able to edit, move, unpublish, hide, lock, delete (or do anything else to) these category pages. 
      – So, I want my "editor" role to have the "page-edit" permission for pages with the templates "C1_p" and "C2_p", but not for the pages with the category templates "C1" and "C2",
      Also, I want my "editor" role to be able to move the pages with the templates "C1_p" and "C2_p" within their parent-pages. 


      Problem:

      But if I just simply add the "page-edit" and the "page-move" permissions for the "C1_p" and "C2_p" templates, then, using the "editor" role, I am not able to move these "C1_p" (and "C2_p") -template-based pages. I can actually click "MOVE" next to them and then move them, but... then I will be met by the error message "You do not have permission to sort pages using this parent - /Category/".  
      – So, I try to add the "page-sort" (description: "permission to sort child pages") permission to the "C1" and "C2" templates... but then trying to do so I am met by the initially mentioned error message   ! Permission “page-sort” for template “C1” not allowed (requires “page-edit” permission)  . 
      And, as mentioned, I do not want my editor role users to be able to edit these category ("C1" and "C2") pages...
      – what to do about this? 😅 
       
      All the best,
      Jonatan 
    • By snck
      Hey there,
      for a client website I need to implement a "reviewer" role. "Reviewers" should be able to review new (unpublished) articles to give feedback to editors, but not have the permission to change them. 
      I built a new "reviewer" role that only has page-view permissions for the respective templates, but this permission does not include viewing unpublished pages. How can I grant them access to the unpublished articles without giving them page-edit permission?
      Cheers,
      Flo
    • By Nik Groningen
      Hi,
      Currently I'm developing a platform and use Processwire for some of the backend. Everything is working very well on localhost, but the installation on namecheap does not complete. I've read some comments on this forum that mentioned hosting on namecheap (without mentioning issues). 
      Attached is a screenshot of the last step of the installation. It looks very similar to the problem mentioned in this thread: https://processwire.com/talk/topic/15516-processwire-do-not-complete-installation/. Unfortunately, this didn't help me. I also attached a picture of the server. In the error_log, i do get some error messages related to includes and requires like:
      [18-Jun-2020 03:42:32 America/New_York] PHP Fatal error:  require(): Failed opening required '/home/niklcicr/public_html/wire/config.php' (include_path='.:/opt/alt/php56/usr/share/pear:/opt/alt/php56/usr/share/php') in /home/niklcicr/public_html/wire/core/ProcessWire.php on line 1199
      On the last screen, the console outputs a internal server error 500.
      That's what I tried: Installation on another server (freeinfinity) and it worked fine, installation on another namecheap account (did not work), and I adjusted the .htaccess file according to other threads in this forum that had similar problems (did not work).
      Is there anyone who got Processwire to work on namecheap hosting or can point me in the right direction? 
      Thanks in advance,
      Nik


    • By snck
      Hey,
      I want my editors to be able to use the page lister, especially the bookmarks. I added the page-lister permission to the editor role, but Page lister ("Find" menu item) does not show. Is there anything else I have to do? Links to bookmarks work for the editors, but I would be glad to show them the menu item as well.
      Maybe this has something to do with the long history of the site (started with ProcessWire 2.4 and upgraded to 3.0.148 over the years)?
      Thanks,
      Flo 
×
×
  • Create New...