[Solved] Change in config.php completely breaks admin panel

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
foto3d
New Member
New Member
Posts: 3
Joined: Tue Feb 07, 2012 10:29 pm

[Solved] Change in config.php completely breaks admin panel

Post by foto3d »

Hi,

I'm running CMS Made Simple 1.10.1. I'm using PHP 5.3.9 and MySQL 5.0.8. This is all working with Apache 2.2.21 running on Linux. The front end site is at http://www.stock3dphotos.net/gamma. I am running this in an original installation in that directory as the root. Eventually I will replace the main site with it.

I am new to CMSMS, but making progress pretty quickly developing my site. I have tried to search for config.php problems thru the Forum, but that term brings up hundreds of results, so I am having trouble narrowing it down.

The problem I am having is that when asked to make a change to config.php, for instance for pretty URLs, adding any additional lines in config.php whatsoever breaks the site completely- I get a blank white screen. It also breaks the resulting website associated with it, of course. I have tried adding other config.php settings as well (such as allowing Smarty tags), but the exact same thing happens..

The only way out is to remove the added config.php line and then everything is back to normal.

I saw that you should flush your cache if you make changes, but alas, that is actually impossible because the admin itself disappears. I even went to the Clear Cache button in Advanced Settings, so all I needed to do was click that after the change, but it still just went white, as the change in config.php seems to preclude admin running at all.

What to do, and why am I seeing this behavior?

Thanks,
Jeff
Last edited by foto3d on Sat Feb 11, 2012 1:52 am, edited 1 time in total.
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Change in config.php completely breaks admin panel and s

Post by jmcgin51 »

why do you need to add lines in the config file? Typically you just edit and/or comment/uncomment lines.

can you give an example of a line you're adding?
foto3d
New Member
New Member
Posts: 3
Joined: Tue Feb 07, 2012 10:29 pm

Re: Change in config.php completely breaks admin panel and s

Post by foto3d »

Hi,

The config.php came with only these lines:

$config['dbms'] = 'mysql';
$config['db_hostname'] = 'localhost';
$config['db_username'] = 'user_name';
$config['db_password'] = '*******';
$config['db_name'] = 'database_name';
$config['db_prefix'] = 'cms_';
$config['db_port'] = 0;
$config['root_url'] = 'http://www.stock3dphotos.com/gamma';
$config['timezone'] = 'America/Los_Angeles';
$config['default_encoding'] = 'utf-8';
$config['debug'] = false

In order to play with dynamic content from our existing PHP scripts, I need to figure out the best way to use them. I wanted to explore Smarty, so I need to add:

$config['use_smarty_php_tags'] = true;

And if I want pretty URLs, I need to add

$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.html';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true; //optional

None of these are currently in my config.php at all- It isn't a case that they are there and commented out- there isn't a placeholder for them at all.

From the config.php settings PDF file, there are 40 different settings that could be set if needed, but installation came with only 11 in the file and I cannot seem to add them from the admin control panel thru click settings. If I manually edit and add them, it stops working completely.

Thanks,
Jeff
jmcgin51
Power Poster
Power Poster
Posts: 1899
Joined: Mon Jun 12, 2006 9:02 pm

Re: Change in config.php completely breaks admin panel and s

Post by jmcgin51 »

first, $config['use_smarty_php_tags'] = true; has nothing to do with running Smarty. This config option allows the use of PHP directly within a page, by using {php} and {/php} in place of <? and ?>

This option is not recommended unless you trust your users, because it allows them to place potentially harmful code directly into page content. The preferred method for allowing PHP is to require the user to use a User Defined Tag, which is then called via Smarty in a page, like {my_udt_name_here}. Users can be restricted from creating UDTs, but can still be allowed to edit page content.

Now, as to why editing config.php causes problems, I'm not sure. I've never run into that.

However, you are using an old $config variable for mod_rewrite. Try $config['url_rewriting'] = 'mod_rewrite';
(Per the config PDF and http://wiki.cmsmadesimple.org/index.php ... l_Settings)
scelle
Forum Members
Forum Members
Posts: 81
Joined: Sun Apr 24, 2011 8:14 pm
Location: Montenegro

Re: Change in config.php completely breaks admin panel and s

Post by scelle »

If you haven't done that already, check out the "CMSMS_config_reference.pdf" file in the "doc" folder of your CMSMS installation.
foto3d
New Member
New Member
Posts: 3
Joined: Tue Feb 07, 2012 10:29 pm

Re: Change in config.php completely breaks admin panel and s

Post by foto3d »

OK, I feel like a dummy. :( The last line of the default config.php is missing the semicolon, which I missed when I added the other lines.

</blush>

Thanks,
Jeff
Post Reply

Return to “CMSMS Core”