TotalCMS blog not uploading photos to server


(Michael Forte) #1

Hi all,

I have integrated TotalCMS into my site and moved my blog from tumblr to https://airportguide.com/blog . Almost everything is working now. I can upload everything in the Admin page except for images.

I drag the images in and save the post. All of the little green checkmarks appear but when I go to view the blog, there is only a placeholder for the image. I looked at the files on my serve and noticed that no images were uploaded. Admin says they were processed but they are not uploading.

Has anyone seen this and does it sound like a TotalCMS bug or a server blocking an upload. All text updates but images don’t which has me completely confused. Any ideas?


(Jason Bostick) #2

I think it is possible that you uploaded images that come from non-https sources and the browser is blocking it, because you have an https address.


(Michael Forte) #3

I forgot to mention that I am logging into Admin and doing everything in https. The files are dragged onto the page from my computer so I’m not sure where that would play into it.


(Doug Bennett) #4

You have errors, Trying to load active content from a non-SSL source:

Check your console:


(Jason Bostick) #5

Doug beat me to it. Not sure if those insecure image links are from old posts (and not the ones in question) but those other errors could be the problem too.

You could also try checking out the TCMS Debug stack in RW and see if there are any errors there. It’d be good to fix the errors Doug is showing anyway but in case they’re not related, the debug stack might give some clues.


(Michael Forte) #6

Thanks for reminding me I have a console to look in. I fixed that lingering http call so that isn’t an issue anymore. The only errors I get now are those google adsense errors that everyone has.

Below is the error log from the last upload I attempted. I have already increased the permissions on all directories from cms-data down to 757 from 755 so I’m not sure what else to try. I’m running on an Apache server if anyone knows where this problem might be fixed.

Remember that creating new posts and modifying any of the text fields works just fine so I must have write access.


Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog-sitemap.xml): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:350)
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.rss): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:394)
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.rss): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:394)
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : ERROR:The cms directory is not writable. Please fix the permissions on the directory: /home/flyingbu/public_html/airportguide/cms-data/gallery/blog/blog/airport-terminal-maps-number-over-350
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] chmod(): Operation not permitted (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Component.php line:307)
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : Saving new content to /gallery/blog/blog/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am.jpg
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : Saving new content to /blog/blog/airport-terminal-maps-number-over-350.cms
Fri, 09 Jun 2017 16:35:47 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.baseurl): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:91)
Fri, 09 Jun 2017 16:35:46 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog-sitemap.xml): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:350)
Fri, 09 Jun 2017 16:35:46 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.rss): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:394)
Fri, 09 Jun 2017 16:35:46 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.rss): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:394)
Fri, 09 Jun 2017 16:35:46 +0000 (72.203.79.170) : Saving new content to /blog/blog/airport-terminal-maps-number-over-350.cms
Fri, 09 Jun 2017 16:35:46 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.baseurl): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:91)
Fri, 09 Jun 2017 16:35:39 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.rss): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:394)
Fri, 09 Jun 2017 16:35:39 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/gallery/blog/blog/airport-terminal-maps-number-over-350/_gallery.json): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Gallery.php line:108)
Fri, 09 Jun 2017 16:35:39 +0000 (72.203.79.170) : ERROR:The cms directory is not writable. Please fix the permissions on the directory: /home/flyingbu/public_html/airportguide/cms-data/gallery/blog/blog/airport-terminal-maps-number-over-350
Fri, 09 Jun 2017 16:35:39 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] chmod(): Operation not permitted (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Component.php line:307)
Fri, 09 Jun 2017 16:35:39 +0000 (72.203.79.170) : Saving new content to /gallery/blog/blog/airport-terminal-maps-number-over-350/airport-terminal-maps-number-over-350.cms
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/blog/blog/blog.rss): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Blog.php line:394)
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] file_put_contents(/home/flyingbu/public_html/airportguide/cms-data/gallery/blog/blog/airport-terminal-maps-number-over-350/_gallery.json): failed to open stream: Permission denied (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Gallery.php line:79)
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : Deleting cms data for gallery/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am-sq.cms
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : Deleting cms data for gallery/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am-sq.jpg
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : Deleting cms data for gallery/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am-th.cms
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : Deleting cms data for gallery/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am-th.jpg
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : Deleting cms data for gallery/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am.cms
Fri, 09 Jun 2017 16:35:19 +0000 (72.203.79.170) : Deleting cms data for gallery/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73806-am.jpg


(Michael Forte) #7

I have some more information. Look at these 2 screenshots. The path to my blog files is root/cms-data/blog/blog. When the permissions of that folder is 755 then none of my posts show up in my Admin blog list. When changed to 757, they now show up.

755 permission: https://drive.google.com/open?id=0B9oOHvcO4zfHODM2Z1lUX2J4dkE

757 permission: https://drive.google.com/open?id=0B9oOHvcO4zfHUk5JWUhzMEVTRmc

Does anyone know about these permission issues? What is Total CMS supposed to use? If it is 755 then why does mine not work unless I open up the write permissions with 757??? I would assume that once this problem is solved then the permissions problem for the photos will be solved as well as I’m sure they are related.

Maybe Rob or Joe have some comments on this?


(Jason Bostick) #8

I saw a post on the other forum and Joe has said it depends on the server environment and that 755 or 757 can both be appropriate depending on your host.


(Michael Forte) #9

Thanks for the info Jason. I got with my ISP and all folders from cms-data down were changed to 777 permissions. Everything works now including the image creation and uploading to the server EXCEPT images are not displayed on the blog.

I tried opening the image by itself and I’m getting an error "403 Forbidden Access to this resource on the server is denied!"
So I looked at Get Info for the image and see that it has an owner and group set at 99. I’m not sure what that means except that all other files on my server have 503 for owner and 504 for group.

I duplicated the image file and the new duplicate has 503 and 504. Guess what? The image loads.

So I have narrowed this down to some kind of TotalCMS “feature” that is uploading the images with the incorrect owner and group numbers.

Does anyone have any insight on this? Also, does this mean every time I create a new post that I’m going to have to set my folder to 777 and fix the owner and group for my images? I don’t think I should have to do that. There must be a way to force those settings on the upload.


(Jason Bostick) #10

That’s above my pay grade, unfortunately. I’d submit a ticket with Joe and see if there’s something they can see (or direct you to tell your host)


(Robert Ziebol 🖖🏼) #11

There are a lot of errors going on if you go to the debug page
https://airportguide.com/rw_common/plugins/stacks/total-cms/totaldebug.php


(Michael Forte) #12

Hi Rob,
I didn’t know/remember about that direct page to debug. I fixed those errors by making the cms directories inside rw_common 757 and I had to change the total-key.php file to 646. All of the errors on the debug.php page are gone.

So I went to do another test and loaded 2 new pictures with one of them featured. If you go to http://airportguide.com/blog/post/?permalink=airport-terminal-maps-number-over-350 you can see the blog post. Notice how the images are just placeholders? I verified they are on my server but like before they have owner and group set at 99. That is the only error. If the owner and group were set correctly then all would be fine.

Suggestions?

EDIT: I should add that new errors show up in the admin debug. I am listing it below. I searched the forums and have seen that these have been around since last year.

Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(2Q==): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/vendor/imagine/imagine/lib/Imagine/Image/Metadata/ExifMetadataReader.php line:96)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(screen-shot-2017-04-19-at-73909-am.jpg): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Image.php line:359)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(2Q==): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/vendor/imagine/imagine/lib/Imagine/Image/Metadata/ExifMetadataReader.php line:96)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(screen-shot-2017-04-19-at-73909-am.jpg): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Image.php line:359)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(2Q==): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/vendor/imagine/imagine/lib/Imagine/Image/Metadata/ExifMetadataReader.php line:96)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(screen-shot-2017-04-19-at-73909-am.jpg): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/TotalCMS/Component/Image.php line:359)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : Saving new content to /gallery/blog/blog/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73909-am.cms
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : ERROR:PHP ERROR [2] exif_read_data(2Q==): Illegal IFD size (/home/flyingbu/public_html/airportguide/rw_common/plugins/stacks/total-cms/vendor/imagine/imagine/lib/Imagine/Image/Metadata/ExifMetadataReader.php line:96)
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : Saving new content to /gallery/blog/blog/airport-terminal-maps-number-over-350/screen-shot-2017-04-19-at-73909-am.jpg
Mon, 12 Jun 2017 14:48:14 +0000 (72.203.79.170) : Saving new content to /blog/blog/airport-terminal-maps-number-over-350.cms


(Joe Workman) #13

Don’t worry about the EXIF errors. They will happen. I tried for a long time to suppress them. PHP insists on throwing them even though the CMS continues just fine when they happen.


(Michael Forte) #14

Glad to hear the EXIF errors are not an issue. So that leaves one problem and I’m thinking you may know the details of what’s happening here. When the images are processed and uploaded to the server they are put with owner and group set at 99. All of my other files on the server are set at owner 503 and group 504. This disconnect is not allowing any user to view the images. I tested this by duplicating the image which has the new file set at 503 and 504. It is then readable.

So is this something in your code that is forcing this owner and group to 99 OR is this something that needs to be changed on the server.


(Joe Workman) #15

This has to do with how the server is setup. Its something that your host will have to fix. Sorry.


(Michael Forte) #16

I thought I remember seeing a problem similar to this. I will work with my ISP and post the resolution here.


(Michael Forte) #17

Here’s an update I received from my ISP. I hope someone can give me some advice on what to do as I don’t understand the ramifications of what I’m being told. From my limited understanding it seems like the correct move would be to get the TotalCMS code modified in the next update to handle this issue as I can’t be the only one with this problem.

The reason why your site’s files are set as UID 503 and GID 504 is that it’s essential to how SuPHP works. SuPHP runs all PHP as the owner, rather than as nobody. This gives inherent security benefits from permissions separation between users. From what I understand, your code is not recognizing this permissions schema and instead is uploading files as ID 99 (nobody), which is incompatible with SuPHP. There are two possible resolutions at this point. The first would be to change handlers to DSO with no Ruid2, which is not as secure, and runs everything as ID 99, which would also mean that all your site files would need to be modified to use ID 99 as well. The other possible option is to modify the code to follow SuPHP’s permissions scheme. How do you wish to proceed?