[solved] Broke admin changing site URL in config.php, Pages not showing in admin

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Post Reply
maxw
New Member
New Member
Posts: 5
Joined: Tue Mar 24, 2009 2:38 am

[solved] Broke admin changing site URL in config.php, Pages not showing in admin

Post by maxw »

Hello...I'm running CMS Made Simple 1.5.2 "Caguas"...PHP 5.2.6...MySQL 5.0.45. This is all working with Apache 2.2.3 running on Linux (Cloud hosting environment from Mosso.com).

The CMS installation was installed on a testing URL provided by the hosting environment.  The testing URL is a subdomain that looks like http://www.mydomain.com/php5-2.dfw1-1.w ... com/. 

Pretty much using all the "out of the box" stuff, added FormBuilder module and MySQLDump for backups.  I also configured to use mod_rewrite so URLs look like mydomain.com/parent/child.

I built out the site, around 150 pages or so (put a lot of effort into)...and got everything working perfectly (very pleased with the CMS).

With everything complete with the site, the next step was to switch the installation to the live hosting domain.  Reading through instructions and forums, this seemed should be as simple as modifying the config.php (file located in the root folder), and updating the $config['root_url'] line with the appropriate URL. ..and of course pointing the domain/DNS to the hosting account.

After making the domain change and updating config.php with the new URL (http://www.mydomain.com), things didn't work right.  Some strange behavior including:

1.  In the Admin area of the site, when clicking the arrows to expand the pages, would get a "XML response was returned from the server is invalid" and a very large error message (not sure but am guessing was AJAX related to the page arrow movement).  So I could not expand the page hierarchy.  After the error, if I then refreshed the page...I would then see the expanded pages.

2.  The front end of the website was no longer rendering the CSS in Firefox at all.  Just copy with no styling.  However, it WOULD render fine in IE7 (go figure!) and other browsers.  I tested this on multiple machines and other networks to confirm nothing was caching on local browsers.  Again prior to changing the config.php, it worked fine in all browsers.  Reading in the forums on CSS issues like this, I found that removing the {style} tag CMS used in the template and replacing with a regular hard coded CSS reference fixed the issue.  Very strange, but that resolved this issue in Firefox (that again wasn't an issue on the testing URL). 

I cleared the cache in Site Admin.  Still same issue on #1.  I then changed the config.php back to the testing URL, then everything was fine again (no XML error and could navigate and edit pages fine).

At this point I went back and forth changing the config.php, thinking I must have something typed wrong, but didn't see any issues and kept seeing the same issue.  Worked fine on the development/testing URL, had issue #1 on the production URL. Slept on it, tried the next day, still same issue.

With the config.php in the "live/production" domain having the issue, I tried adding a new page just to see what it would do.  After trying to add a page, it removed everything from the pages section in the admin...clearing out all references in the pages section.  So under "Content/Pages" it now just shows a blank white page.  It seems something go re-indexed and lost references to the page data.  However, all of the pages and content still show fine on the frontend of the site...so the content is there.

Unfortunately now, with the config.php in the testing URL, or the desired production/live URL (tried both), the pages in the admin do not show at all (just a white page). 

The front end of the website still shows fine...so again the data is there...just can no longer edit/add anything in the admin.

Any ideas on how to correct this would be greatly appreciated.

Thanks,

Max
Last edited by maxw on Wed Mar 25, 2009 1:18 pm, edited 1 time in total.
alby

Re: Broke admin changing site URL in config.php

Post by alby »

maxw wrote: With everything complete with the site, the next step was to switch the installation to the live hosting domain.  Reading through instructions and forums, this seemed should be as simple as modifying the config.php (file located in the root folder), and updating the $config['root_url'] line with the appropriate URL. ..and of course pointing the domain/DNS to the hosting account.
And your paths?
My advice when you move on different (provider|server|platform|whatever) test this new condition with an install (in a subdir for example), check for (different settings|problems) and test frontend/backend. It's ok? then move your site and check the old config with new config url/paths (in general 5 variables url/paths + DB credentials)

Alby
maxw
New Member
New Member
Posts: 5
Joined: Tue Mar 24, 2009 2:38 am

Re: Broke admin changing site URL in config.php

Post by maxw »

Alby,

Thanks for the reply.  I didn't move the development website or re-locate to another web hosting provider.  The folder paths stayed the same, and the database stayed the same, just tried to update the URL to the live/production domain by modifying config.php.

Any other thoughts?

Max
alby

Re: Broke admin changing site URL in config.php

Post by alby »

maxw wrote: Thanks for the reply.  I didn't move the development website or re-locate to another web hosting provider.  The folder paths stayed the same, and the database stayed the same, just tried to update the URL to the live/production domain by modifying config.php.
Run install/install.php and uncheck in step 5 writing table and sample.
This create a new config.php con correct url/paths

Alby
maxw
New Member
New Member
Posts: 5
Joined: Tue Mar 24, 2009 2:38 am

Re: Broke admin changing site URL in config.php

Post by maxw »

I tried this re-installation procedure, but still the same issue. 

By creating a new config.php from scratch, it overwrote the mod_rewrite settings in the config.php (changed assume_mod_rewrite from true to false), so I removed the htaccess rewrite to take this out of the equation. 

Still everything on the front end displays fine (content is all there), but on the admin side when I click Content/Pages, no pages are displayed.  I still have the header area of the admin showing here, and the "Current Pages" heading, but no pages are shown (just white area) nor are there any links to add pages, etc.  It's like the "pages" area of the admin is just broken, but no error messages.  All other areas of the admin work fine. 

Since the front end works fine, and can navigate around in the admin...it seems the paths have to be right.  I cleared the cache again in the admin (Site Admin/Global Settings) as well after the re-install.
maxw
New Member
New Member
Posts: 5
Joined: Tue Mar 24, 2009 2:38 am

Re: Broke admin changing site URL in config.php

Post by maxw »

I didn't even have to move the files, nor did I have it in any subfolder off the root.  It was installed into the root of the hosting account.  The way this hosting provider works (www.mosso.com) is when you setup a hosting account, they give you a "testing" domain so you can start using it immediately without having any DNS/domain pointing to it. 

The testing domain looks like http://www.mydomain.com/php5-2.dfw1-1.w ... tlink.com/ (where mydomain.com is the site URL). 

So I build the site on that testing domain.

Once development was completed, I changed the config.php root URL to allow it to work with the live production domain (no files moved, no database moved, no changed paths), and pointed the DNS to the IP address of the hosting account (same as the testing URL).  After updating the config.php, I cleared the cache in the admin, and also as you suggested checked via FTP that all of the temp files were gone (leaving folders and index.html files in place).

At this point I had the issues described above (items 1 and 2).  Didn't make any sense and figured *something* had to be cached, so did the cache clearing via admin and FTP a few times with no luck.

Since I wasn't getting anywhere, I tried to add a new page just to see what it would do, and it somehow cleared all references to everything in content/pages (prior just had the error when expanding the pages, now they're completely gone).  So the front end shows everything fine (data is there), I just can't edit anything because pages in the admin is empty now.

I've looked all over the forums trying to find if anyone has had the same issue.  I came across this post http://forum.cmsmadesimple.org/index.ph ... 281.0.html which sounds exactly like my current situation...content displays...but none of the pages show to edit.  I contacted this poster, and he said he still has the problem.  Like me, he said he has installed/used CMS MS on a few websites with no problem.  So is really a puzzling one.

Does it sound possible this is some kind of data corruption?  Could the CMS have tried to re-index when I tried to add a page, and somehow created a disconnect?  Or does this still sound like a caching issue?

Thanks again,

Max
alby

Re: Broke admin changing site URL in config.php

Post by alby »

maxw wrote: Does it sound possible this is some kind of data corruption?  Could the CMS have tried to re-index when I tried to add a page, and somehow created a disconnect?  Or does this still sound like a caching issue?
Data corruction no because you see the page in frontend ...
Look in http access log for exact GET url that you retrieve and in error logs for other infos

Alby
maxw
New Member
New Member
Posts: 5
Joined: Tue Mar 24, 2009 2:38 am

Re: Broke admin changing site URL in config.php

Post by maxw »

Mark- I'm sorry for creating confusion on the hosting situation, I messed up in the testing URL example I gave having a slash in there (making look like was in a subfolder).  The testing URL was like http://www.mydomain.com.php5-2.dfw1-1.w ... tlink.com/ so was not in a subfolder (just a subdomain).

Alby - I enabled error logging...and this identified the cause of pages not viewing in the admin...it was a php memory limit issue.  The error log looked like:

PHP Fatal error:  Allowed memory size of 33554432 bytes exhausted (tried to allocate 262745 bytes) in /mnt/folderpath/www.mydomain.com/web/content/admin/listcontent.php on line 960

I increased the memory from 32m to 64m, and now the pages are showing in the admin...so THANK YOU!!

What's puzzling to me is how this issue wasn't exposed until I changed config.php switching the domain name.  Perhaps clearing the cache in the process created a need for more memory allocation on the server.

I still have an issue with getting XML errors when I click the arrows in content/pages, but at this point I can hit "refresh" and still get to the pages to edit...so this is works for now and will come back to this and try to figure out.  The critical thing that came up (not being able to edit everything) has been addressed so will call this one solved.  Thank you again for your help. 

For those experiencing the issue where content shows OK on the front end of your website, but pages can't be viewed/edited in the backend in the admin (you get a blank page when viewing pages), it may be a memory allocation issue with the web hosting account.  If you're on Apache, you can verify by checking your error logs by putting the following in your .htaccess file (assuming your host permits):

# enable PHP error logging
php_flag log_errors on
php_value error_log /path/www.yourdomain.com/web/content/error.log

In the above that path to the error.log will need to match your hosting environment.  You also need to upload an empty error.log file to the server, and give it 777 permissions.  Viewing this log file will expose what problems may be occurring.

The memory allocation variable can be set in config.php, there is a line that looks like:
$config['php_memory_limit'] = '';

Depending on your hosting provider, you may also be able to set the memory allocation in the .htaccess file which is what I did, my .htaccess file looks like this to make work:

# set php memory limit
php_value memory_limit 64M

By default it was 32mb, so the above increased it to 64mb.

Thanks again for the help!

Max
Post Reply

Return to “CMSMS Core”