Jump to content

[Solved] Permission problem – no access to /site/assets/


rash
 Share

Recommended Posts

Hi guys,

bad day today. I first updated PW to 3.0.42, everything went fine without any problem. Then I changed the PHP version of my (shared) server and the weirdness started:

1. I switched from PHP 5.5 (Apache module) to 7.1 in CGI mode. There were a few minor issues with too less function parameters that I got fixed in minutes. The only real strange thing was that no images were shown anymore, neither in frontend nor in backend. Trying to call an image directly by it’s URL led to a 403 message, telling me  I don’t have access to the site/assets directory.

2. To find out whether the problem is specific to PHP 7.1, I »downgraded« to 7.0 and 5.6 in CGI mode, both didn’t change anything.

3. I finally »reset« everything to the 5.5 version as Apache mode again, now everything seems to be broken. In frontend I get

Compile Error: require_once(): Failed opening required '~/site/modules/TextformatterTextile/src/Parser.php' (include_path='~/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone:.:/usr/share/php:..') (line 39 of ~/site/modules/TextformatterTextile/TextformatterTextileField.module)

(The file is definitely there). In the backend I receive

DirectoryIterator::__construct(~ /site/assets/files/1148/): failed to open dir: Permission denied The process returned no content.

when I try to edit a page.

There seems to be a serious permission problem, but I don’t know where to start. If nothing helps, I will ask my provider for a yesterday’s server backup, but I would prefer to understand at least the basics of what is going on.

UPDATE: Meanwhile I returned to the PHP 7.1. update. At least this situation hasn’t changed: all is working well except the images are still missing, in frond- and backend as described above. The require_once errors are gone, so my ideal solution would be to stay with PHP 7.1. but with correctly displayed images.

Link to comment
Share on other sites

You definetly have to check the user rights. If you prviously used apache module, and afterwards changed to cgi mode, I bet that this are different users on the server. Common usage on shared hosts is, that php as apache module is a user something like wwwrun. As cgi version, mostly it is identical with your own ftp user. So, after you switched to cgi, all messages that say you don't have the access rights to the assets directory totally make sence!

  • Like 2
Link to comment
Share on other sites

31 minutes ago, horst said:

You definetly have to check the user rights. If you prviously used apache module, and afterwards changed to cgi mode, I bet that this are different users on the server. Common usage on shared hosts is, that php as apache module is a user something like wwwrun. As cgi version, mostly it is identical with your own ftp user. So, after you switched to cgi, all messages that say you don't have the access rights to the assets directory totally make sence!

Thanks Horst for pointing to the right direction – after inspecting how to solve the problem concretely, I found a provider’s ReadMe telling me bascially the same. The offered options are exactly two: owner is either 'User' (Me) or 'PHP-User', named '33'. When I set the owner of /site/assets/ to 'User' (recursively), nobody will see not even a single image. Chosing the second option 'PHP-User', I receive the completety irritating require_once error (and nobody will see anything else at all). As there is no third option available I don’t see the right method to get it done.

Link to comment
Share on other sites

4 hours ago, rash said:

When I set the owner of /site/assets/ to 'User' (recursively)

Your permission issues may be affecting all PW files. This error...

Compile Error: require_once(): Failed opening required '~/site/modules/TextformatterTextile/src/Parser.php' (include_path='~/wire/modules/Markup/MarkupHTMLPurifier/htmlpurifier/standalone:.:/usr/share/php:..') (line 39 of ~/site/modules/TextformatterTextile/TextformatterTextileField.module)

...relates to a file outside /site/assets/. So when you are testing the change of owner you should do this for all PW files.

  • Like 1
Link to comment
Share on other sites

1 hour ago, Robin S said:

So when you are testing the change of owner you should do this for all PW files.

Okay, now I set all files on the server to owner 'User'. Still no image is shown, not in frontend, not in backend. Sad, but true. I’ll better try to cry myself into sleep now, this day definetely was’nt mine.

Link to comment
Share on other sites

Problem solved. After mailing the provider, everything mysteriously started to work as it should. I fear, I don’t really understand what exactly caused the problems – some weird combination of »properties« and »permissions«, his explanations were not to detailed. So thanks again Horst and Robin for your help.

Ralf

  • Like 1
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...