Error when moving site

A place to discuss and receive support for LCMS (Little Content Management System)

Postby njw » Tue Nov 14, 2006 11:19 am

I've just moved the site to a different hosting area, and I am getting this error:

Fatal error: Call to a member function on a non-object in /home/archomai/public_html/templates_c/default/%%D7^D73^D73BB5E8%%MainTemplate.html.php on line 54

I can't get into the file to see what is causing the error. Any thoughts?

Many thanks

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Nov 14, 2006 12:17 pm

OK.. this is solvable, and is probably just a really simple little thing, but your inability to access the file will make this a bit tricky.

You probably cannot see the file because it was created by the web server and won't allow your user to read it. Hence to access this file, you must use the web server process.

Make a simple PHP script on your web server with the following:

Code: Select all



Then run this script from your web browser. This will display the contents of that file in an array. The suspect line should be located at index 53 of the printed array.

That will give us a clue as to what object it can't find.

Most likely this is an issue with the .htaccess file - or perhaps even a petty connection issue with the database.

Best regards

Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Tue Nov 14, 2006 1:43 pm

Thanks Steve. I think it's a connection issue, because it's now gone away since I got the nameservers corrected. However, I've now lost all the formatting and images ... I'm checking through all the file references and pointers now to see what needs to be corrected.

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Tue Nov 14, 2006 1:59 pm

I was wrong - the change is that it is writing the error to the log file now ...
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Tue Nov 14, 2006 2:02 pm

Lines 53 & 54 are as follows:
[53] =>
_tpl_vars['page']->val('header_image')): ?>style="background:#505050 url(_tpl_vars['ENV']['DATAFACE_SITE_URL']; ?>
[54] => /tables/pages/header_image/_tpl_vars['page']->val('header_image'); ?>
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Tue Nov 14, 2006 2:13 pm

OK.. so it appears it is not managing to load the requested page from the database. Is this appearing on a page where the content is drawn from the database, or from the file system? If you can give me the url, I can take a closer look to see if anything jumps out.

As it is, I'd say the problem probably lies in the .htaccess file or the apache config file (perhaps not allowing certain options to be used in the .htaccess file).

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Tue Nov 14, 2006 2:16 pm

The url is www.archomai.co.uk. The admin module is working fine. This is occurring on all pages.

It is a new site, but the same hosting company. Possibly a different server.

The .htaccess file is:

RewriteEngine On
RewriteRule ^$ index.php
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule ^(.*)$ public.php?-path=$1

RewriteCond %{HTTPS} !=on
RewriteCond %{REQUEST_URI} ^.*admin\.php
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [L,R]


Deny from all

#
#RewriteEngine on
#RewriteCond %{SERVER_PORT} =80
#RewriteRule ^(.*) https://%{SERVER_NAME}%{REQUEST_URI}
#

SecFilterEngine Off
SecFilterScanPOST Off
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Tue Nov 14, 2006 2:38 pm

If it's any help, it doesn't seem to recognise the [ENV] and/or [APPLICATION] variables. Nothing that refers to them is being displayed.
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Tue Nov 14, 2006 4:18 pm

It is definitely something to do with $ENV not being set. I have deleted the $ENV.DATAFACE_SITE_URL from MainTemplate.html and the formatting has come back. The edits should solve my problem short-term: getting the web site looking reasonable, but I would still like to put it back the way it was!

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Wed Nov 15, 2006 3:00 am

Hi Steve

Overnight, I have changed nothing, but now there are errors occurring on different lines and the site will not display. Any thoughts?

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Wed Nov 15, 2006 3:01 am

Ignore the above - looking at the wrong site!

Regards

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby shannah » Wed Nov 15, 2006 4:11 pm

Is it at all possible that the new site is using a different installation of Dataface (an older install) than it was on the older server?

The $ENV variable is crucial to the templates.

One possibility is also that the compiled template is for an older install. Making any changes to the MainTemplate.html template should update the timestamp and cause the template to be recompiled though - this could be the actual reason why removing $ENV.DATAFACE_SITE_URL made it work before.

-Steve
--
Steve Hannah
@shannah78 (on twitter)
sjhannah.com blog
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Wed Nov 15, 2006 11:16 pm

The version of dataface is the same. I copied the whole site over (it was a sub directory of the QSG site.

My hosting company have said "the only difference is that Register_globals is OFF on the new server (much safer with regard security)". Could this be the problem?

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Thu Nov 16, 2006 12:26 am

Having done some searching, and acknowledging my limited understanding of PHP, I have tried changing my htaccess directive to set Register_globals to on, but this causes the site to error. Do I need to change the startup code code somehow?

Many thanks

Neil
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Postby njw » Thu Nov 16, 2006 6:15 am

Almost there - I've amended all the $ENV references to $_ENV. Now the menu tabs have gone missing, but that's probably just a tag in the worng place, I hope!
njw
 
Posts: 280
Joined: Wed Dec 31, 1969 5:00 pm

Next

Return to LCMS Discussion

Who is online

Users browsing this forum: No registered users and 0 guests

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved