burty1109 Posted January 30, 2018 Share Posted January 30, 2018 (edited) Howdy Prestashop lovers I am having a major problem with Permissions on my installation of prestashop 1.7.2 It has installed and we are operational however the following issues are occurring. Initially -> 403 Errors in some modules and on some pages --> corrected with this line in the .htaccess file --> SecFilterEngine Off However: MAIN ISSUE --> Everytime you install a module, the folders are written 0777 and files all are 0666 (our server blocks these permissions). The module has errors until you change all files to 0755 and 0644 Everytime the site_map is created via CRON --> written 0666 and google cannot read it. All files in app/cache/prod --> all 0777 and 0666 Some modules are not working fully as I suspect has something to do with permissions either with database or what is causing the problem above. When you FTP a file or using Bash, it copies, creates fine.. no problem. What have I tried? Brand new installation of prestashop on same server using sub domain name on same URL instead of www.mywebsite.com --> test.mywebsite.com Same issue --> Version 1.7.2.. tried installation using instaltron and using the prestashop installation --> same issue. When I install Prestashop 1.6 on test2.mywebsite.com --> all good, it works fine.. something is causing a problem with version 1.7.. does anyone know of a security issue with 1.7, or something I have left out of .htaccess or the like? Where are the permission setting kept in prestashop 1.7? Using PHP7.1 Would love some help please. Thanks Stu Edited January 30, 2018 by burty1109 (see edit history) 1 Link to comment Share on other sites More sharing options...
jetx Posted January 30, 2018 Share Posted January 30, 2018 Have you looked at umask settings on your server? Should most likely be 0022. Link to comment Share on other sites More sharing options...
burty1109 Posted January 30, 2018 Author Share Posted January 30, 2018 Thanks jetx.. yes it is 22.. Link to comment Share on other sites More sharing options...
jetx Posted January 30, 2018 Share Posted January 30, 2018 ok if it's 0022, then check your server doesn't have more than 1 file, profile or /etc/bashrc. Link to comment Share on other sites More sharing options...
burty1109 Posted January 30, 2018 Author Share Posted January 30, 2018 Checked, thanks for your help.. The weird thing is that everything is ok, including PS1.6.. it seems something related to Version 1.7 Link to comment Share on other sites More sharing options...
jetx Posted January 30, 2018 Share Posted January 30, 2018 You're welcome. Note: Doesn't happen to me with 1.7. It must be umask though, perhaps the way your system is handling zip files. Link to comment Share on other sites More sharing options...
jetx Posted January 30, 2018 Share Posted January 30, 2018 Like to just get working with it until you figure it out just putty to the root of your 1.7 site and type: find . -type d -exec chmod 0755 {} \; find . -type f -exec chmod 0644 {} \; This will at least fix everything for now. 1 Link to comment Share on other sites More sharing options...
burty1109 Posted January 30, 2018 Author Share Posted January 30, 2018 Thanks jetx... I believe it is umask related, but maybe the application is setting its own umask We have changed all files to 0755 and 0644 however the cache files are updating all the time. So yes the site is usable, but this problem lingers over our head. Do you know if PS17 has a config file for permissions, I know 1.5 used to display the write permissions in the administration tab. Link to comment Share on other sites More sharing options...
burty1109 Posted January 30, 2018 Author Share Posted January 30, 2018 Thanks jetx... I believe it is umask related, but maybe the application is setting its own umask We have changed all files to 0755 and 0644 however the cache files are updating all the time. So yes the site is usable, but this problem lingers over our head. Do you know if PS17 has a config file for permissions, I know 1.5 used to display the write permissions in the administration tab. Link to comment Share on other sites More sharing options...
burty1109 Posted January 30, 2018 Author Share Posted January 30, 2018 Further to my post. To fault find, I signed up to a completely new Host, they use CPANEL -> Host Gator. I loaded the latest download from Prestashop 1.7.2.4 Uploaded to public_html -> uncompressed and loaded the install. Nothing I am doing on my other site has any relevance to the new site.. new account, different company. Kept everything apart.. Prestashop loaded up ok.. 0755 and 0644 .. except 2 or 3 modules.. Ok, so I now load modules.. SAME problem, all the modules load up 0777 and 0666 all files/folders Other people must be suffering the same problems. PLease help Link to comment Share on other sites More sharing options...
jetx Posted February 1, 2018 Share Posted February 1, 2018 I have no other ideas, maybe also check the apache user, group. Link to comment Share on other sites More sharing options...
burty1109 Posted February 6, 2018 Share Posted February 6, 2018 Hi again --> I think we are getting close. Has anyone had anything to do with Symfony.. here is the reasons '/public_html/bridge_zN8C4f38.php' has the following on line 978:umask(0);This would change the umask for your user to create files with 666/777 permissions.Does anyone know what this 'bridge_zN8C4f38.php' file is used for? Looking in that '/ -- /public_html/app/cache/prod/' folder, we can see the file 'classes.php' has a number of references to the umask, we think this is most likely the cause of the permissions issues in that folder. Any more help would be appreciated. Thanks Link to comment Share on other sites More sharing options...
884483048 Posted April 11, 2018 Share Posted April 11, 2018 Whether the problem solved or not? Experiencing same issues in different environments. jetx Could you post your config example please? Link to comment Share on other sites More sharing options...
jetx Posted July 26, 2018 Share Posted July 26, 2018 (edited) To my knowledge this is still a major issue with prestashop 1.7. No matter what umask you have set and whether you chmod every file to 644 the program will set cache files to 666, etc. edit: note this is theme cache (css, js). Smarty cache correctly sets the permissions. Mentioned here, no resolution (hardly surprising): forge.prestashop.com/browse/BOOM-2948 Edited July 26, 2018 by jetx (see edit history) Link to comment Share on other sites More sharing options...
burty1109 Posted July 26, 2018 Share Posted July 26, 2018 Hi there No, I just run FTP program to change all the permissions 0755 0644 for the module. Still waiting for an answer, every module loads with the 0777 0666 Link to comment Share on other sites More sharing options...
burty1109 Posted July 27, 2018 Share Posted July 27, 2018 Hi again I just installed the new 1.7.4 installation to my VPS --> in a test environment.. The problem seems so much worse --> now all modules are 0777, Even the files are 0777. Does anyone have any ideas? Installed via Softaculous, so now I have witnessed the problem through 3 seperate hosting companies, 2 via Shared and now in a VPS environment --> surely everyone is suffering the issue? Thanks Link to comment Share on other sites More sharing options...
jetx Posted July 28, 2018 Share Posted July 28, 2018 I started another forge report for this but I think the prestashop team are too clueless to care about it and besides I feel Symphony is beyond their knowledge which is probably why they can't fix it. No matter what umask is set the ruddy program will create files and directories within cache with 666, 777 and some 771. It's a frigging mess so I run without using cache, including theme css and js cache. To set everything in your root use terminal and type: find . -type d -exec chmod 0755 {} \; and then find . -type f -exec chmod 0644 {} \; Link to comment Share on other sites More sharing options...
jetx Posted July 29, 2018 Share Posted July 29, 2018 (edited) Partially fixed mine (eg theme cache is fine now, but a few directories in var/cache are still being created to 777, files 666, no errors so will leave it like this for now) by editing classes/prestashopautoload.php ln 254: @chmod($tmpFile, 0644); and src/core/cldr/repository.php ln 76: $this->oldUmask = umask(0022); ln 80: mkdir($this->cldrCacheFolder.DIRECTORY_SEPARATOR.'datas', 0755, true); and for smarty: vendor/smarty/libs/sysplugins/smarty_internal_runtime_writefile.php ln 31: $_file_perms = property_exists($smarty, '_file_perms') ? $smarty->_file_perms : 0644; ln 33: property_exists($smarty, '_dir_perms') ? (isset($smarty->_dir_perms) ? $smarty->_dir_perms : 0755) : 0755; There were some other changes I made, but not sure they'll be needed so reverted to the above to just these three files. Will update if any issues. Edited July 29, 2018 by jetx (see edit history) Link to comment Share on other sites More sharing options...
MathiasReker Posted February 24, 2019 Share Posted February 24, 2019 I think this module can help you out: https://github.com/MathiasReker/filepermissions 2 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now