The ultimate fix for permissions
When I was installing Zencart the permissions issue haunted me.
Setting numeric chmod to 777 is a security hazard and frowned upon, however some Zen Cart manuals sold publicly state that it should be used or 755.
Now, 755 means that group has read and execute permissions but cannot write, the ZC installer complained that certain files and folders were not writable.
So, finally the solution dawned on me, I remembered that in my olden days (2007), I used group www-data.
The following instructions are valid only for a LAMP (Linux, Apache, Mysql, PHP) server using Debian or a derivative like Ubuntu, I don't know about nginx or Windows.
You must use a command line, I don't know Cpanel or similar stuff.
Now, with that out of the way:
Under group www-data will work the PHP, mysql and Linux scripts that need to write during installation, so you need to change ownership of the whole site to your_user:www-data by placing your terminal above the directory were you unzipped your ZC files, which is /var/www/html and issue command from root or another user with superuser privileges (sudo user):
chown -R my_user:www-data my-site.com.
So we have changed ownership, now change permissions:
chmod -R 775 mysite.com.
After you have executed these instructions the installer will proceed.
Enjoy.
Re: The ultimate fix for permissions
Respectfully, I'd like to point out that all this is taken care of by proper installation in better than 95% of installations as most have their site on other than a locally-controlled server. 755 for folders and 644 for files is considered the norm. Setting the two configure.php files to 444 AFTER they are completed is a good safety measure.
Your directions MAY be required for your particular setup but, I would caution anyone to stick with the specs found at https://docs.zen-cart.com/.
Bookmark this. Use it. If it's wrong or confusing fix it or report it in the forum.
Re: The ultimate fix for permissions
Quote:
Originally Posted by
dbltoe
Respectfully, I'd like to point out that all this is taken care of by proper installation in better than 95% of installations as most have their site on other than a locally-controlled server. 755 for folders and 644 for files is considered the norm. Setting the two configure.php files to 444 AFTER they are completed is a good safety measure.
Your directions MAY be required for your particular setup but, I would caution anyone to stick with the specs found at
https://docs.zen-cart.com/.
Bookmark this. Use it. If it's wrong or confusing fix it or report it in the forum.
I very much respect your dedication to zencart and free software.
I also respect your seniority and the way you answer posts in forums.
I made clear that these instructions are meant for people who duke it out in the terminal.
I installed the same way on a public website in my signature (under construction).
In the Linode cloud I selected a Debian server, the same OS that I use in my home office, there are no differences.
I saw that Apache server uses group www-data (apache2 config file), used to be httpd.conf in my olden days long ago.
I went though a long hiatus, and recovery, so my memory of the fixes I implemented waned so I approach everything related to tinkering with utmost caution.
In fact, at every step I run the apache2 configtest to make sure that there are no mistakes, there weren't any, it's logical to set group to www-data to make apache happy.
That's how I set up zencart in the public server too.
If users are on shared or managed hosting they will pay more to get power, free software will give power for a fraction of the cost, it's up to you.
Thank you for your contributions.
Re: The ultimate fix for permissions
I fear that I did what most might do (and caused me to respond as I did). I read all but line 5 of your post.
I saw "The following.." and went straight to "You must...".
And, with the title of "Ultimate fix of permissions" I was mentally fixated on making sure no one tried that on standard hosting.
Apologies, with a request that future posts be more informative as to their direction/application. It will help those who find these threads in the future.