Jump to content

Recommended Posts

Hi

 

I don’t know if this problem has already been raised, if so could anybody please point me in the right direction.

 

I have managed to successfully install prestashop. In the guide it says I may have to switch chmod to 777 to install, which I did. Then it says to switch back to 775 or 755, which I did. After switching back to a safer setting nothing works. I tried all settings and it only works with 777, which I have been advised not to use. Can anybody explain what is happening and how I make the prestashop work with 775 or 755.

 

I’m pretty new to all this back end stuff so it’s all beyond me at the moment. I use WHM / cPanel and could get the guys who provide hosting to setup, only thing is they want to charge a small fortune for their support / help. If anyone could explain what I need to do it would be very much appreciated.

 

Thanks!

Link to comment
Share on other sites

Thanks for your quick reply.

 

I would have thought so, but wouldn’t know exactly where to look to find the log. Yes I was told 755 for directories and 644 for files, but following the prestashop installation guide it says to apply 755 to certain folders only, and 755 to certain folders and all files within that folder. Would it be a case of going through every folder separately and applying the correct chmod?

 

The hosting provider mentioned switching to suPHP, which again I don’t really know what they’re talking about.

 

Thanks

Link to comment
Share on other sites

I am not sure if suPHP is compatible with prestashop. Ask them if they support suexec module and if they do ask them to enable it. They shouldn't charge you anything for this.

 

You can also apply the 755 mod for folders and 644 for files by yourself like you described. But prestashop unfortunately needs write access to a few directories like /config /download /upload /modules . Thus the wrong suggestion of 777 which makes them world writable.

 

What we do in these cases is to have the owner running apache get full access (rw) to those directories instead of having them world writable.

 

Another thing you could ask from your provider is to add your account to the apache group. In that case a 775 for folders and 660 for files would work. (It still not secure though since all other accounts that belong to this group will have write access to your files)

 

Things like these require a good understanding between you and your host provider.

 

BTW We provide a free 2 week trial on all of our hosting plans if you would like to try.

 

Regards,

 

George

Link to comment
Share on other sites

I don't know which method you used to install prestashop but most people upload the files using an FTP program via the FTP access provided with your hosting account.

 

One such program and one of the better ones is Fillezilla. With Filezilla you can easily set the permissions of your files and folders.

Link to comment
Share on other sites

I don't know which method you used to install prestashop but most people upload the files using an FTP program via the FTP access provided with your hosting account.

 

One such program and one of the better ones is Fillezilla. With Filezilla you can easily set the permissions of your files and folders.

 

I currently use Fillezilla, and set the permissions to 777 on the the correct folders (for installation). Following this (after installed) when I tried to set back to 755, nothing worked on the front end or back end. It gave some random error message.

Link to comment
Share on other sites

I am not sure if suPHP is compatible with prestashop. Ask them if they support suexec module and if they do ask them to enable it. They shouldn't charge you anything for this.

 

You can also apply the 755 mod for folders and 644 for files by yourself like you described. But prestashop unfortunately needs write access to a few directories like /config /download /upload /modules . Thus the wrong suggestion of 777 which makes them world writable.

 

What we do in these cases is to have the owner running apache get full access (rw) to those directories instead of having them world writable.

 

Another thing you could ask from your provider is to add your account to the apache group. In that case a 775 for folders and 660 for files would work. (It still not secure though since all other accounts that belong to this group will have write access to your files)

 

Things like these require a good understanding between you and your host provider.

 

BTW We provide a free 2 week trial on all of our hosting plans if you would like to try.

 

Regards,

 

George

 

Hi George, thanks for the info.

 

Problem is I can't speak with anybody from support, I can only speak with sales people who have to pass messages between us.

 

I have a dedicated server with many sites so I wouldn't really want to move provider unless I have to.

 

Thanks

Link to comment
Share on other sites

 

I currently use Fillezilla, and set the permissions to 777 on the the correct folders (for installation). Following this (after installed) when I tried to set back to 755, nothing worked on the front end or back end. It gave some random error message.

 

Ah, OK, I assumed you didn't use Filezilla as you said

 

Would it be a case of going through every folder separately and applying the correct chmod?

Thanks

 

With Filezilla you right click on the folder on the remote site, select file permissions and it gives options to recurse to subdirectories for all files and directories, files only and directories only.

 

So using this you do not have to go through every folder to apply the correct CHMOD.

 

Regarding the 777 Vs 755 issue, some servers require, mine included, 777 CHMOD. With 755 the front end still functions correctly but there are many things in the BO that will not. For example, translations. So I generally CHMOD the folders that require being writeable to 777 until my site configuration has been completed. When no more changes are required I change those folder back to 755.

Link to comment
Share on other sites

 

Hi George, thanks for the info.

 

Problem is I can't speak with anybody from support, I can only speak with sales people who have to pass messages between us.

 

I have a dedicated server with many sites so I wouldn't really want to move provider unless I have to.

 

Thanks

 

No problem, if it is a dedicated server then do you have shell access ? If you do, then enter the directory where the shop resides and do the following:

 

find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

 

This will fix ownership to 644 for files and 755 for directories

 

Then, assuming that the user apache runs is www, you can find that information from /etc/passwd, apply the following:

 

chown www:www config
chown www:www tools/smarty/compile
chown  www:www tools/smarty/cache
chown  www:www tools/smarty_v2/compile
chown  www:www tools/smarty_v2/cache
chown  www:www sitemap.xml
chown  www:www log
chown -R www:www img
chown -R www:www mails
chown -R www:www modules
chown -R www:www themes/prestashop/lang
chown -R www:www themes/prestashop/cache
chown -R www:www translations
chown -R www:www upload
chown -R www:www download

It is important that you apply ownership to the correct user. In some Linux systems its www-data, others apache and finally www.

Link to comment
Share on other sites

Appreciate you both taking the time to help out here. May not have been too clear as I don’t really know what I’m talking about and I’m getting confused :(

 

At the moment when the prestashop folders are 755 (as stated in the guide) nothing works, so I currently have them as 777 and everything works. My hosting provider said I have to enable suPHP, to allow me to apply 755 and 644 permissions. Following that no php scripts will work on my server until all directories became 755 and files 644. So I was thinking I’d have to go through every site and change them one by one or recurse into subdirectories. George, are you saying if I enable suPHP (whatever it is), I can add the above code to one area to change all directories and files at once on all my sites?

 

Cheers

Link to comment
Share on other sites

Appreciate you both taking the time to help out here. May not have been too clear as I don’t really know what I’m talking about and I’m getting confused :(

 

At the moment when the prestashop folders are 755 (as stated in the guide) nothing works, so I currently have them as 777 and everything works. My hosting provider said I have to enable suPHP, to allow me to apply 755 and 644 permissions. Following that no php scripts will work on my server until all directories became 755 and files 644. So I was thinking I’d have to go through every site and change them one by one or recurse into subdirectories. George, are you saying if I enable suPHP (whatever it is), I can add the above code to one area to change all directories and files at once on all my sites?

 

Cheers

The first part of my code is just a means of adjusting the file & directory permissions. It assigns 644 for files and 755 for folders.

The rest assigns proper ownership to the user under apache is running.

 

If you don't have a basic understanding of UNIX commands and hierarchy please don't use it!

 

If your websites only work with 777 permissions it means that there are some serious issues with the whole set up.

 

In order to be able to troubleshoot better I would need the following:

 

1) a part of the error logs from apache (you can obscure IPs and domains)

2) an ls -l of the parent directory

3) your apache directive for the site in question

 

George

Link to comment
Share on other sites

I just installed the Prestashop but couldn't find anywhere the exact list of folders and file that need permission changed... In the "getting started" doc, it just says:

 

"Changing file/folder permission on a Unix/Linux system is called a "CHMOD". Giving them "write permission" is called "doing a CHMOD 755" or "a CHMOD 775", depending on the host."

 

and then:

 

"Some hosts might require you to use CHMOD 777, although it is not recommended for anything more than a one-time need. If you have to use CHMOD 777 in order to install PrestaShop, make sure to switch to a safer setting (775, 755 or even 644) once you are done installing."

 

But there's no list of folders/files which need permission changed with their corresponding permission digits...

 

I remember in older versions of Prestashop there was an entire list given, but it was a few months ago and the link to this doc is not available anymore...

 

Please help with this info if you can...

Thanks, Eugene.

Link to comment
Share on other sites

  • 5 months later...

Hi guys,

 

I currently try to move my project from local MAMP development (everything worked fine) to a apache web server.

 

The apache runs as user "www-data". I have SSH access and I excecuted the following commands:

  
find . -type f -exec chmod 644 {} \;
find . -type d -exec chmod 755 {} \;

chown www-data:www-data config;
chown www-data:www-data tools/smarty/compile;
chown www-data:www-data tools/smarty/cache;
chown www-data:www-data tools/smarty_v2/compile;
chown www-data:www-data tools/smarty_v2/cache;
chown www-data:www-data sitemap.xml;
chown www-data:www-data log;
chown -R www-data:www-data img;
chown -R www-data:www-data mails;
chown -R www-data:www-data modules;
chown -R www-data:www-data themes/e-mail-sounds-v1/lang;
chown -R www-data:www-data themes/e-mail-sounds-v1/cache;
chown -R www-data:www-data translations;
chown -R www-data:www-data upload;
chown -R www-data:www-data downloads;

 

Still I get a "Fatal error: Uncaught exception 'SmartyException' with message 'unable to write file htdocs/tools/smarty/compile".

 

In order to validate a fresh install on the same server I also tried a fresh installation. After executing the above commands the installation script gives me the following configuration-errors:

PHP settings (for assistance, ask your hosting provider):

ALL OK

 

Write permissions on files and folders:

/config : FALSE

/tools/smarty/compile : TRUE

/tools/smarty/cache : TRUE

/tools/smarty_v2/compile : TRUE

/tools/smarty_v2/cache : TRUE

/sitemap.xml : FALSE

/log : FALSE

 

Write permissions on folders and subfolders/recursively:

/img : FALSE

/mails : FALSE

/modules : FALSE

/themes/prestashop/lang : FALSE

/themes/prestashop/cache : FALSE

/translations : FALSE

/upload : FALSE

/download : FALSE

 

Optional set-up

ALL OK

 

Any ideas how to get this shop running?

 

Thanks for your support

Rassy

Edited by rassy (see edit history)
Link to comment
Share on other sites

Hi guys,

 

please read my post above...

 

... update: I got a bit further with the clean installation of prestashop 1.4.8.2 on the same server.

 

I did a "chown -R www-data:www-data *" on the htdocs root and managed to pass page number 2. :-)

 

BAD NEWS: Now I am stuck on Page number 4 (Shop configuration). I have all data filled out and press NEXT, but NOTHING HAPPENS. There is no error message. It just ajax-loads very shortly and then stays on the same page.

 

It seems like the script still is not able to write the configuration file.

 

MY QUESTIONS:

1) Do you guys have any suggestions?

2) Is it really save to do a general "chown -R www-data:www-data *" on the whole script?

 

Thanks for your support!

Rassy

Link to comment
Share on other sites

  • 3 months later...

Hey rassy I know your probably pass this point but for anyone interested it would be better to use

find img/ -type d -exec chown www-data:www-data {} \;

replacing the "img/" part with whichever directory your altering. The chown -R command your using will change the ownership of all directories as well as all of the files, which is unnecessary.

Link to comment
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
×
×
  • Create New...