Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

Blank Pages on my Live site.


Reply

4 Posts   1549 Views

Avatar
SLJ

2 July 2007 at 8:13am (Last edited: 2 July 2007 8:15am), Community Member, 23 Posts

I have a site on a remote shared hosting server. I am testing the site in a subdomain like http://testing.mydomain.com. Everything works perfectly there. I also have files on my local machine. I uploaded the files from my local machine to my public_html directory so that that the site would be available from http://www.mydomain.com.

After uploading the files I confirmed that my _config.php is correct and tried to access the home page. No joy. There is no error, the page is just blank. I tried starting over with no success. I thought it may be because both the live version and the testing version are hitting the same database. I duplicated my database and now the live version hits dbRealData and I changed the test version so it hits dbTestData. The pages are still blank.

I think it has something to do with mod_rewrite. I changed my .htaccess rewrite rule from:

RewriteRule .* sapphire/main.php?url=%1&%{QUERY_STRING} [L]

to:

RewriteRule .* testing/sapphire/main.php?url=%1&%{QUERY_STRING} [L]

Now it displays pages, but all my URLs are similar to http://www.mydomain.com/**testing**/home/ or some variation of that. (** for emphasis only)

Even though I'm basically routing my pages through the testing configuration, when I make changes to the live domain, it's updating the live version of the database (dbRealData)

Does anyone have any suggestions on what I could try to fix this?

[Sidebar: Does anyone know how long the forum search may be disabled? I think something like this may have been discussed before, but I can't find it]

Avatar
Andy

6 July 2007 at 9:14am 230 Posts

The blank page is most likely due to the site being in Live mode, which will hide errors. You can set it to dev mode in your _config.php by adding the line:

Director::set_environment_type('dev');

You can get rid of the 'testing' in your URLs by adding this line to the _config.php:

Director::setBaseURL('http://www.mydomain.com/');

The database updating on the live site suggests that you haven't changed the database details for the testing site?

Avatar
SLJ

6 July 2007 at 7:13pm (Last edited: 6 July 2007 7:59pm), Community Member, 23 Posts

The first thing I did was add the line to put the site in dev mode. Then I took testing/ out of my .htaccess file. The pages still came up blank.
I double checked both _config.php files and they are not pointing to the same database. The live site is pointing to the live DB and the testing site is pinting to the testing DB.

I tried setting the staging site into dev mode by changing its _config.php but that had no effect at first. I added testing/ back to my live .htaccess file so it started using my staging files again. Then I started seeing errors.

XML Parsing Error: xml declaration not at start of external entity
Location: http://www.mydomain.com/home/?flush=1
Line Number 2, Column 1:

<?xml version="1.0" encoding="UTF-8"?>

I took this line out of the live Page.ss and still got the error. I took it out of the testing site Page.ss and the pages displayed as they had before, with /staging in the URLs. The interesting thing is that the line causing the error above was not on line 2, it is line 1 of the Page.ss file. There was no blank line before it either. I don't know if that matters.

At this point I know that it is definitely using the testing site pages to display, but it's reading the live _config.php and calling the live database. I don't understand why it doesn't just use the live files for the display. To double check this again, I changed the wording of something by directly editing the live database and I changed the testing site CSS to alter the display colors. I'm definitely getting testing site display with live data.

Is _config.php the only place that references which database it should use? Originally both sites were pointing to the live data. I changed the testing site to point to a testing db, but I only changed it in _config.php.

Avatar
xmedeko

9 July 2007 at 2:37pm Community Member, 94 Posts

Check your php files. If they have blank lines after the final '?>', remove them.