Jump to content

Page not loading on 1 site but loads on other


Recommended Posts

Hi PW Community,

I have a problem where a page is loading up fine on my local dev machine + 1 of the test sites, but not on another test site.

They have identical PW (2.8.35?) and codebase installed.

The 2 sites are hosted on the same hosting provider, as well as our other sites.

1) Error Logs. There is nothing particularly strange logged on the PW Error log for all the sites. I am getting a "You must assign a template to the page before setting custom field values (title__data) [pageClass=Page, template=] (WireLog)" error, but I'm getting this error on working pages as well.
 However, there are some errors in our Hosting Provider's log. The error seems to point at some sort of permissioning issue regarding reading the image files?

1.a) File / Dir permissions of Images  - I've checked file permissions on the normal and problematic sites. They are all identical

2) .htaccess  -  I've tried running the .htaccess file from the working site on the problematic site - No Luck

3)  codebase - I've done 3 comparisons. They are identical on all sites.

4) wire directory - See above

5) Behaviour - So the problematic site loads up most of its page as expected without problems. It's just a couple that it has issues with.


Problematic URL Example  : http://kinder-reime.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/

Working URL : http://finger-spiele.com/kindergedichte/kategorien/gedichte-fuer-kindergarten-und-schule/

I've also attached the KIS Error Logs.

Has anyone come across  behaviour like this before and what would be the way forward to fix this?


Link to comment
Share on other sites

Did you also check the owner:group for the images that are not loaded, e.g. /site/templates/img/square/kinderlieder-ueber-den-fruehling.jpg?

I had an issue once with host europe where the owner:group of files were wrong after uploading through FTP. I needed to ask their support to change file ownership to default.

In the logs it says: No such file or directory for the images that are problematic.
Are you sure that they are there?

And in your templates/php/site/SquareImage.php you could do a check like file_exists() before processing the images to avoid a crash in case the image is not there.

  • Like 1
Link to comment
Share on other sites

Hi @gebeer, thanks for the response. To answer your questions :

1) The owner / group of all the image files are the same. They belong to the owner / group name that bears the account name. 

2) The files are definitely all there. I haven't checked all of them but I've spot checked about a dozen and they are there as expected.

3) Looks like I already have code file_exists check in SquareImage.php, albeit I'm checking for the full path, not the path that starts with /site/template ... Is there a PW API call that does a file check that takes in a path name that starts with /site/templates .... ?

Edited by FrancisChung
Additional question
Link to comment
Share on other sites

3) when checking for file_exists, always use full path. Does it return false? If not, the file is readable. In the docs it says
This function returns FALSE for files inaccessible due to safe mode restrictions. However these files still can be included if they are located in safe_mode_include_dir.
So you might want to check for safe_mode. But you are saying other sites on the same server are running fine. So I guess its not safe_mode related

1+2) Did you compare file ownership and permissions with other sites installed on the server, anything unusual?

Maybe have a look here to understand how permissions on host europe servers work: https://www.hosteurope.de/faq/webhosting/webpack/dateirechtestruktur/

Other than that I would have no clue either...

  • Like 1
Link to comment
Share on other sites

@gebeer, I've checked the folders and they all have the same directory owner/group settings.

I would imagine if there was a problem on the directory level, I would be seeing this issue all over the place and not a couple of specific pages.

I've also spotted some bugs in the last 15minutes and have eliminated them so the only issues I see now are the permission issue(s) with the image files. I'm going to add some extra debugging, error handling to see if I can shed any more light into it. 

Link to comment
Share on other sites

@gebeer: I've managed to eliminate all errors that were displaying in the KIS Error logs. And the page still won't load ... :'(

At this point, the only thing left is to use the working site as a base and try updating its codebase + data and hope for the best.


Link to comment
Share on other sites

I discovered an error with the config.php file in the following line 

$config->chmodDir = '0755'; // permission for directories created by ProcessWire

It was set to '0' not '0755'. 

Alas, it wasn't the cause of my issue  ...


I've narrowed it down to it being something in the backend database. If I point the (not working) codebase to an older database, it seems to load up.

Unfortunately, I've tried to compare the database dump scripts between the 2 databases and I can't make heads & tails sense out of it.

Anyone has any suggestions for comparing 2 databases? Some custom code?

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

  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Similar Content

    • By spercy16
      These issues should be fairly easy for any intermediate to advanced ProcessWire developer to answer. I'm new to PHP and relatively new to ProcessWire and just need a bit of help. What I'm trying to do is bring in a couple of cards from my Projects page to display on my home page. I finally got the code right to bring in the cards but right now they're using my original images instead of my resized "variations". So firstly, I would like to know how to reference the variations of my images instead of using the original. Secondly, I need to grab only four of the cards from the Project page and not import in all ten. It should be just two small changes to my code to do these things (I would imagine). Here is the code I currently have for that section:
      <?php // https://processwire.com/api/arrays/ // check if the array of images has items if (count($pages->get("/projects/")->images)) : // get array of images from the field $images = $pages->get("/projects/")->images; $count = 0; // iterate over each one foreach ($images as $image) : $count++; $sectionText = $pages->get("/projects/")->get("paragraph_$count"); $img = $image; $buttonCode = $pages->get("/projects/")->get("url_$count"); ?> <span id="card<?php echo $count?>" class="card"> <img class="cardThumb" src="<?php echo $img->url; ?>" alt="<?php echo $image->description; ?> Thumbnail" /> <div class="cardBody"> <div class="cardText"> <h2><?php echo $img->description; ?></h2> <?php echo $sectionText; ?> </div> <div class="primaryBtn"> <a href="https://www.paypal.com/donate?hosted_button_id= <?php echo $buttonCode; ?> &source=url"> <button> <i class="fas fa-donate"></i> Donate </button> </a> </div> </div> </span> <?php endforeach; endif; ?> Thanks in advance for any help!
    • By picarica
      so hello there i have fiel field type i have lots of stuff there, and also an image i can easily get image from that field using
      $options = array('quality' => 85, 'upscaling' => true, 'cropping' => 'north', 'sharpening' => 'medium'); $word = ".png"; // Test if string contains the word foreach($childgames->subor_hry as $file) { if(strpos($file, $word) !== false){ /* $imger = $file->size(473, 266, $options); */ echo $file; /* echo $file->url; */ } } so i get the fiel i tried invoking size on it like the commented out part and it doesnt work i get error Oh snizzle… Error:     Exception: Method Pagefile::size does not exist or is not callable in this context (in
      what am i doing wrong? can you guys help me by all logic this should work
    • By rjgamer
      is there a hook after the current (active) page got created? Or which method got called in the Page class after the Constructor of the current page got initialized?
    • By Max Esnée
      When I upload a large(ish) SVG (≈120ko in this case) into an image field, it tends to get stuck at 100% and block the whole website. If I force refresh the admin page, the svg has not been uploaded. The file is correctly copied into the assets folder though. Other svg tends to be uploaded fine albeit I've noticed that pages containing svg images in the admin are very slow to load generally. Other pages using the same template but with jpeg or png images are much faster to load.
      I get the following error in the JS console:

      I develop locally using MAMP on macOS and I'm using Firefox. I'm using the last ProcessWire version (3.0.165).
      I also tested in Chrome and got the same error.
    • By rjgamer
      Hi guys,
      the field "redirect_last" of type DateTime got not updated. The update on the field "redirect_counter" works and got saved.
      Does anybody know what I did wrong in my code?
      if ($input->urlSegment(1) === 'redirect') { $page->of(false); $page->redirect_last = time(); $page->redirect_counter += 1; if ($page->save('redirect_counter')) { $session->redirect($page->website_url, 302); } } Thanks.
  • Create New...