Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-01-21 00:05:56

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

No thumbnail editing after move from subdomain to root (4.0.8rc2)

I don’t know if this is caused by Txp or by my way of doing things… Here is what I did:

  1. developed a site in a subdomain (test.domain.com, 4.0.7 install)
  2. upgraded to 4.0.8rc1 without problems
  3. upgraded to 4.0.8rc2 without problems
  4. to move the site to the root (domain.com)
    • copied the files and images folders from /path/to/subdomains/test/httpdocs to /path/to/httpdocs (in Plesk), and
    • ftp’d the /textpattern and /rpc folders, .htaccess and index.php from the download tar.gz
    • (and copied and edited config.php of course)

Now in the root install I can’t edit thumbnails of images that were copied from the test dir:

Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/home/httpd/vhosts/domain.com/httpdocs/images/23t.jpg’ for writing: Toegang geweigerd in /home/httpd/vhosts/domain.com/httpdocs/textpattern/lib/class.thumb.php on line 250

Warning: chmod() [function.chmod]: Bewerking niet toegestaan in /home/httpd/vhosts/domain.com/httpdocs/textpattern/lib/class.thumb.php on line 320

Permissions are 777. Editing newly added images’ thumbnails works fine. So does replacing existing images (though it doesn’t want to replace the thumbnail).

Robert said here:

Might be caused by running the web server process as a different user than the one you use for FTP uploads?

Don’t know if that could apply here as well, but as far as I can see user (and group) are the same for all files and directories. I may have copied the images directory as a different user, but I’ve also tried replacing the images using ftp and wouldn’t that have solved it? It didn’t.

Offline

#2 2009-01-21 06:04:49

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

Els wrote:

Permissions are 777.

Are these the permissions of both the image directory and each individual thumbnail file?

Offline

#3 2009-01-21 17:45:26

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

The files inside /images are 644. I didn’t think that would be a problem, since the image files in the subdomain were also 644. I’ve been trying a couple of things:

Trying to chmod the image files to something else, up to 777, using the ftp client, each try gave me an ‘operation not permitted’.

Then I ftp’d an image file and it’s thumbnail from the subdomain to my desktop, I verified that it still was 644. Ftp’d it to the root install, and permissions had (automatically?) changed to 744. When I then tried to resize the thumbnail, again I got this warning:

Warning: imagejpeg() [function.imagejpeg]: Unable to open ‘/home/httpd/vhosts/domain.com/httpdocs/images/24t.jpg’ for writing: Toegang geweigerd in /home/httpd/vhosts/domain.com/httpdocs/textpattern/lib/class.thumb.php on line 250

Warning: chmod() [function.chmod]: Bewerking niet toegestaan in /home/httpd/vhosts/domain.com/httpdocs/textpattern/lib/class.thumb.php on line 320

… but the resized thumbnail was actually saved.

After uploading the files to the server, I was able to change permissions again:
Chmodding it back to 644 made it impossible again to edit the thumbnail.
Back again to 744: still the same warning, and no updated thumbnail.
Up to 777:

Warning: chmod() [function.chmod]: Bewerking niet toegestaan in /home/httpd/vhosts/domain.com/httpdocs/textpattern/lib/class.thumb.php on line 320

Mini-afbeelding 23 opgeslagen.

And the thumbnail was indeed updated. I also tried if changing permissions in Plesk’s file manager made a difference, but it gave the same results.

I’m sorry to bother you with this, as I suspect it is not Txp related. I can work with it, now that I know which steps to take (though I keep seeing those warnings). But I just don’t understand why the same permissions work in the subdomain and not in the root install. I’d ask my host about this, if only I knew what to ask exactly…

Offline

#4 2009-01-21 17:57:26

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

Els wrote:

I’d ask my host about this, if only I knew what to ask exactly…

Ask whether the user you use for ftp differs from the user which runs Apache and PHP, and in case those two differ how you are supposed to create files through ftp which would subsequently be (over-)written by the web server’s user.

Offline

#5 2009-01-21 17:59:19

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

Thanks, will do!

Offline

#6 2009-01-22 00:29:49

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

One more question, Robert, if you don’t mind.

I figured out what is happening: files created (or uploaded) in Txp (images, thumbnails, files in the files tab) – only these files – have user: apache and group: apache. All other files (whether I copy them or ftp them) show the user I use for ftp and a different group. Only when I move a file with user/group apache to another location, user and group remain unchanged. As soon as I copy them user and group are changed, and Txp isn’t allowed to edit them anymore. I now know exactly what to ask the host :/ This isn’t only a problem for this particular site, I recently moved some 10+ sites over there, it goes for all of them…

Before I contact the host about this, can you tell me if those files’ user and group are determined by Txp or by the server settings? (I guess it’s the latter, but just in case he tells me that it’s my CMS’s fault, I’d like to know what to reply…)

Last edited by els (2009-01-22 00:46:58)

Offline

#7 2009-01-22 01:13:38

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

Precisely, the owner of all files created by Textpattern (or any other PHP application on your server) is the user who runs PHP. It’s a matter of how the hosting company set up its hosting environment.

PHP can be run in various ways, e.g. by using either (Fast)CGI or as an Apache module (mod_php).

  • When PHP is run as an Apache module, the “apache” user runs PHP.
  • When PHP is run as a (Fast)CGI application, it typically runs in the context of your “own” user. This user is commonly used as an FTP user, too.

Offline

#8 2009-01-22 16:42:21

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: No thumbnail editing after move from subdomain to root (4.0.8rc2)

Thank you, it’s crystal clear to me now :) I contacted the host, sure there must be ways to handle this.

Offline

Board footer

Powered by FluxBB