Jump to content

PS1.7 Permissions Files Folders 0777 0666 Problem with CHMOD & 403 Erros


burty1109

Recommended Posts

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 by burty1109 (see edit history)
  • Like 1
Link to comment
Share on other sites

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.

  • Like 1
Link to comment
Share on other sites

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

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

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

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

  • 2 months later...
  • 3 months later...

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 by jetx (see edit history)
Link to comment
Share on other sites

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

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

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 by jetx (see edit history)
Link to comment
Share on other sites

  • 6 months later...

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...