2.1 Setting the proper rights to folders and files using Chmod

After uploading Prestashop to your host you need to set the proper permissions to your folders by “ch-modding” them.

Setting permissions using Filezilla

Connect to your host using Filezilla (Think your hosting is cheap? try HostingXs ) and open up the root folder of Prestashop and select the following folders by clicking the folders with your mouse while holding the CTRL-key:

  • /config
  • /upload
  • /download
  • /log
  • sitemap.xml (file)

Click on the selected folders with the right mouse button and choose “File permissions…” like the following screenshot shows.

Changing file permissions in Filezilla.

After doing so a screen opens up called “Change file attributes” apply the following and click OK.

 

Changing file attributes in Filezilla.

Now do the same for:

  • /tools/smarty/compile
  • /tools/smarty/cache
  • /tools/smarty_v2/compile
  • /tools/smarty_v2/cache

Setting permissions recursively

Then do the same thing again only this time check the box for “Recurse into subdirectories” and make sure the radio button is set to “Apply to all files and directories“:

Changing file attribute recursefily in filezilla

Do this for the following folders:

  • /img
  • /mails
  • /modules
  • /translations
  • /upload
  • /download

And for:

  • /themes/prestashop/lang
  • /themes/prestashop/cache

Change the chmod back to 775 and 644 for security reasons

What Prestashop doesn’t tell you is to change it back after your done leaving the webshop with a huge security risk!

So I Googled it and found the following article: “Is setting chmod to 777 dangerous“.

So after your done with the next step (Installing Prestashop using the automatic installer) change your folders to chmod 755 and your files to 644 for security reasons.

Tags: , , , , ,

4 Responses to “2.1 Setting the proper rights to folders and files using Chmod”

  1. Question June 8, 2012 at 5:39 am #

    Hi,

    I’m wondering, when you are changing the CHMOD back after having got Prestashop running, when chainging back permissions for
    /img
    /mails
    /modules
    /translations
    /upload
    /download

    And you check the box for “Recurse into subdirectories” and make sure the radio button is set to “Apply to all files and directories“ and set CHMOD to 755 as they are files, but it then changes all the files as well… Should the files be 644? What to do?

    Great blog thanks!

    • Thomas Barbillion June 10, 2012 at 12:50 pm #

      Well good question. I understand the fact that the folders should be protected but changing all the files in those folders manually would be a job for a script at least give all the files in the root the proper rights.

      Kind regards,

      T. Barbillion

Leave a Reply