Jump to content
rash

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

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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...