Page 1 of 1

CMSMadeSimple With MSSQL

Posted: Mon Feb 05, 2007 9:31 pm
by madelyn
Hello:
I'm trying to install cms with mssql, because cms supports adodblite.    But install fails.    I am using cmsmadesimple-1.0.4 and adodb_lite1.42.

Thanks for your collaboration :)

Re: CMSMadeSimple With MSSQL

Posted: Tue Feb 06, 2007 11:51 am
by Dee
Hi, currently CMS Made Simple only supports MySQL and Postgres databases.
There is no option to use a MS SQL database during install.

What do you mean install fails? How did you try to install on MS SQL? Did you modify the install to be able to select mssql?

Regards,
D

Re: CMSMadeSimple With MSSQL

Posted: Tue Feb 06, 2007 2:12 pm
by madelyn
Yes I modified install.php, but the dump file is not compatible with mssql.

Any Idea?

Re: CMSMadeSimple With MSSQL

Posted: Tue Feb 06, 2007 2:41 pm
by Dee
I never used MS SQL, so no idea. What errors do you get?
BTW: someone else is also trying to get CMS Made simple to work with MS SQL: http://forum.cmsmadesimple.org/index.ph ... 827.0.html

Re: CMSMadeSimple With MSSQL

Posted: Thu Feb 08, 2007 6:37 pm
by madelyn
Hello:

I had been installed cmsms with mssql:

* First I did it in mysql
* Second I exported the data base to mssql.

After solved all the small problems, still have one problem:

The default page shows error 404, but only works  with direct link.

What could be the error?

I Use adodb and IIS.

Madelyn :-)

Re: CMSMadeSimple With MSSQL

Posted: Thu Feb 08, 2007 7:56 pm
by Dee
madelyn wrote: The default page shows error 404, but only works  with direct link.

What could be the error?

I Use adodb and IIS.

Madelyn :-)
Is it a IIS 404 error or the one generated from CMS (Site Admin -> Global Settings in the admin menu)?
IIS is configured to use index.php as directory index?
Any PHP errors (check apache access/PHP error log)?

Regards,
D

Re: CMSMadeSimple With MSSQL

Posted: Thu Feb 08, 2007 9:08 pm
by madelyn
Hello:

No.  It's Shows  cmsms  page 404 error.

index.php is the primary document in IIS.

Madelyn

Re: CMSMadeSimple With MSSQL

Posted: Thu Feb 08, 2007 9:44 pm
by Dee
madelyn wrote: No.  It's Shows  cmsms  page 404 error.
Madelyn
Hmm, I assume you made sure "Enable Custom 404 Message" is unchecked in the Global Settings?

It's hard to tell what goes wrong without any further debugging info.
There's a couple of things you can check to find out what's going on:
* CMS: set $config['debug'] in config.php and check for errors - other than Error (0) which means no error
* PHP: set PHP's error_reporting to E_ALL and see if PHP gives any notices/warnings/errors
* SQL: I'm not familiar with MS SQL, but it must have logging options and maybe log level settings - enable logging, set appropriate logging level and check the SQL server logs

Regards,
D

Re: CMSMadeSimple With MSSQL

Posted: Mon Feb 12, 2007 11:23 am
by AndyHolyer
OK, I've made some progress here.

It's necessary the edit schema.php (I'll fix it with some ifdefs and submit the diffs when all this is solved) since MS SQL needs a datetime field specified as DATETIME rather than DT which MySQL allows. If you don't make this change, MS SQL quietly fails to create the required table.

That gets you through the install process. I haven't entirely solved this yet, but fetching

http://myhost/cmsmadesimple/

returns a 404. However a fetch to:

http://myhost/cmsmadesimple/index.php?page=home

works. Also the admin pages etc. all work. However the stylesheet formating comes up broken.

Looking at the source, I've worked out the reason:







If I change the & entity to its correct "&" then I get the stylesheet. Otherwise I don't.

However the apache site does the same thing... Hmm.

More news as I come to it.

The gloaters amongst you will be pleased to hear that there's a pronounced performance hit with the MS products: but as I said before I'm doing this for politcal reasons rather than technical.

Re: CMSMadeSimple With MSSQL

Posted: Mon Feb 12, 2007 3:24 pm
by madelyn
Hello:

Thanks about your help.  Works very well.


I have a problem, I don't know if  is the database or  adodb.

Cmsmadesimple cuts templates and long style sheets when keeping them.

I use PHP 5, MSQL Server Enterprise 8,0 ADOdb 1,42 and cmsmadesimple 1.0.4

I tried too with adob-lite.

Please tell me about the success stories.

Thanks about your collaboration,

Madelyn  :-)

Truncated data from database (Was: Re: CMSMadeSimple With MSSQL)

Posted: Thu Feb 15, 2007 10:34 am
by AndyHolyer
I think I've worked out the fix for this. And the bug is so amazingly, mind-bogglingly stupid that I'm still not sure that I've really cracked it. But it seems to work. In fact it's worse than that: no only does MS SQL have a feature that seems to have no utility beyond causing hard-to-find bugs, but PHP collaborates with it with the finesse of Laurel and Hardy to make the whole thing far, far worse.

If I told you that MS SQL had a parameter which specified the maximum length of a string returned in a query, you'd think I was mad, wouldn't you? Not the maximum length to store internally (which would have been bad enough), but the amount to return in a query. BUT THERE IS.It's called TEXTSIZE. Honest.

What possible utility could this parameter have? Was there a meeting somewhere in Redmond some Monday morning where the executive put forward: "Hey, what about if our customers wanted to store their data on our database, but only get the first couple of pages back? Can we do that, guys?". Sheesh.

OK, this seems mad enough. SO I fire up Query Analyser and type SELECT @@TEXTSIZE. I get back 64512. A funny number to have hardcoded in (I'd have expected 65536), but not something that I would expect to bite me in the bum.

Now we get to PHP's routine with the baggy trousers and bucket of whitewash. The MSSQL module has a parameter for TEXTSIZE (and also for TEXTLIMIT, which souds similarly worrying). If you don't specify it in php.ini, it has a default. The default is 4096. Bytes. Now, I was led to look at this when I found that the truncated templates seemed to be about 3825 cheracters long (I'm on Windows XP so I don't have nice stuff like wc, so I have to paste the text into Word and do a word count. Now, I@m just guessing that 3825 plus an extra character for each line-ending would add up to 4096?

There's shades of Bill Gates' comment about nobody ever wanting more than 640K.

OK, fire up emacs on php.ini. mssql.textsize and mssql.textlimit are commented out. Uncomment them, set them to 1000000, restart IIS from the sevices controller. Problem seems to have gone away.

So it's even more stupid than I first thought: It's storing the whole string internally, just only returning the first 4096 bytes. Again, why owuld anyone ever want to set this?

Now I've just got to figure out why it 404's on an empty page request.....

Drowning, not waving, Andy.

Re: Truncated data from database (Was: Re: CMSMadeSimple With MSSQL)

Posted: Mon Mar 05, 2007 7:07 pm
by madelyn
Hello;

Thanks a lot,

AndyHolyer wrote: There's shades of Bill Gates' comment about nobody ever wanting more than 640K.

OK, fire up emacs on php.ini. mssql.textsize and mssql.textlimit are commented out. Uncomment them, set them to 1000000, restart IIS from the sevices controller. Problem seems to have gone away.

So it's even more stupid than I first thought: It's storing the whole string internally, just only returning the first 4096 bytes. Again, why owuld anyone ever want to set this?
It works very good,  Thaks a lot :-).
AndyHolyer wrote: Now I've just got to figure out why it 404's on an empty page request.....
I fixed this problem (momently) with movedPages plugin. 


God Bless you,

Madelyn :-)

Re: CMSMadeSimple With MSSQL

Posted: Wed Aug 22, 2007 4:34 pm
by ebrentnelson
Hey guys! I think I found and fixed the problem with the 404 loading... it looks like there is a SQL error in class.pageinfo.inc.php.

Look at like 106, there is a query string that looks like this:

Code: Select all

$query = "SELECT c.content_id, c.content_name, c.content_alias, c.menu_text, c.titleattribute, c.hierarchy, c.metadata, c.id_hierarchy, c.prop_names, c.create_date AS c_create_date, c.modified_date AS c_date, c.cachable, c.last_modified_by, t.template_id, t.encoding, t.modified_date AS t_date FROM ".cms_db_prefix()."templates t INNER JOIN ".cms_db_prefix()."content c ON c.template_id = t.template_id WHERE (c.content_alias = ? OR c.content_id = ?) AND c.active = 1";
Well, in my case this was using 15 as my parameter... which makes the query look like this after being processed:

Code: Select all

$query = "SELECT c.content_id, c.content_name, c.content_alias, c.menu_text, c.titleattribute, c.hierarchy, c.metadata, c.id_hierarchy, c.prop_names, c.create_date AS c_create_date, c.modified_date AS c_date, c.cachable, c.last_modified_by, t.template_id, t.encoding, t.modified_date AS t_date FROM ".cms_db_prefix()."templates t INNER JOIN ".cms_db_prefix()."content c ON c.template_id = t.template_id WHERE (c.content_alias = 15 OR c.content_id = 15) AND c.active = 1";
The problem with this is that c.content_alias is a varchar field and thus cannot be compared to an integer. SO, I changed the simple ? (question mark) to cast( ? as varchar ) and that fixed it.