Stylesheet.php throwing internal server errors (500)

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
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

I thought I had this problem solved earlier, but no.

I'm running CMS 1.4.1 with no modules installed other than those included in the default distribution package.  About a month ago, I started noticing core dumps accumulating on my Site5 server.

Upon closer examination of the error logs, I found these core dumps associated with error log entries like these three examples:

74.229.183.17 - - [21/Oct/2008:19:08:23 -0500] "GET /stylesheet.php?cssid=42&mediatype=screen HTTP/1.1" 500 - "http://www.carolinagodiva.org/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"

74.229.183.17 - - [21/Oct/2008:19:08:23 -0500] "GET /stylesheet.php?cssid=45&mediatype=screen HTTP/1.1" 500 - "http://www.carolinagodiva.org/" "Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.0.3) Gecko/2008092417 Firefox/3.0.3"

99.194.1.238 - - [22/Oct/2008:09:00:12 -0500] "GET /stylesheet.php?cssid=43&mediatype=screen HTTP/1.1" 500 - "http://www.carolinagodiva.org/" "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US) AppleWebKit/525.13 (KHTML, like Gecko) Chrome/0.2.149.30 Safari/525.13"

In other words, the error is always associated with a GET /stylesheet.php . . . .

The cssid identifies the css sheet stored in the site's mySql database, but is isn't always the same cssid number that causes the error, and the same css files are more often than not accessed without problem at other times.

Often, but now always, the error appears in nearly simultaneous pairs, as with the first two examples above.

I was originally running the site  under version 4.x of php.  Changing to version 5.x didn't fix the problem of core dumps (though the size of the dumps is smaller).

A reinstall of CMSMadesimple  1.4.1 did not fix the problem.

A check of the css in each of the stylesheets associated with an error did not find any problems I could see with that code.

Here's the system information outout:

----------------------------------------------

Cms Version: 1.4.1

Installed Modules:

    * CMSMailer: 1.73.14
    * FileManager: 0.4.1
    * MenuManager: 1.5.1
    * ModuleManager: 1.2.1
    * News: 2.8.2
    * nuSOAP: 1.0.1
    * Printing: 0.2.5
    * Search: 1.5.1
    * ThemeManager: 1.0.8
    * TinyMCE: 2.4.5
    * SystemInfo: 0.1.2


Config Information:

    * php_memory_limit:
    * process_whole_template: true
    * max_upload_size: 2000000
    * default_upload_permission: 664
    * assume_mod_rewrite: false
    * page_extension:
    * internal_pretty_urls: false
    * use_hierarchy: false


Php Information:

    * safe_mode: Off (False)
    * phpversion: 5.2.1
    * memory_limit: 32M
    * max_execution_time: 30
    * gd_version: 2
    * session_save_path: No check because OS path


Server Information:

    * Server Api: cgi
    * Server Db Type: MySQL (mysql)
    * Server Db Version: 4.1.22


----------------------------------------------

Curiously, the php memory limit field is blank, but phpinfo() shows it to be 32m. There is a ! flag by Maximum Execution Time = 30, but I'm not sure if that is really the issue.

Any rate. I'm stumped.  Help!  I otherwise really like CMSMadeSimple,  being a refugee from Mambo ...

pjb@godiva
 
alby

Re: Stylesheet.php throwing internal server errors (500)

Post by alby »

pjb@godiva wrote: Curiously, the php memory limit field is blank, but phpinfo() shows it to be 32m. There is a ! flag by Maximum Execution Time = 30, but I'm not sure if that is really the issue.

Any rate. I'm stumped.  Help!  I otherwise really like CMSMadeSimple,  being a refugee from Mambo ...
I saw this many times with php cgi (or better fast-cgi)
Your hosting php is not well tuning but usually it isn't a problem (is a problem if you have missing stylesheet that render wrong your pages)

"php_memory_limit" is empty because is empty in your config.php (Look it's relative to "Config Information") while "memory_limit: 32M" in "Php Information"
Try to increment memory in config.php:
$config['php_memory_limit'] = '64M';

Alby
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

Thanks for the tip on setting the php memory limit.  I've set it to 64M in config.php, but am still getting the core dumps associated with stylesheet.php.
Pierre M.

Re: Stylesheet.php throwing internal server errors (500)

Post by Pierre M. »

Core dump or http 500 ?
Is the log you are showing the error log rather than the access log ?
This /stylesheet.php specialization is strange...

Pierre
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

Pierre,

You correctly point out a misstatement in my original post:  I gave three examples of the errors I'm getting as they show up in  the Apache access log.  The 500 status code pinpoints an internal server error, and I get a core dump associated with every one of these.

When I ran CMS under php 4, there was a "premature end of script" message in the system's error log at each instance of the problem.

pjb@godiva
alby

Re: Stylesheet.php throwing internal server errors (500)

Post by alby »

My mistake, stylesheet read config.php but not set memory_limit
Add ini_set in stylesheet.php or add a php.ini in cms_root (but check if php read this)

Alby
Pierre M.

Re: Stylesheet.php throwing internal server errors (500)

Post by Pierre M. »

An execution time limit or a memory limit or such a limit can trigger a PHP "premature end of script" in the error log. I think Alby is right pointing in this memory direction.
"Of the importance of the http error log"... ;)

Pierre
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

Bumping up the memory limit to 64M did not solve the problem.  I do now know how to increase the max_execution_time parameter.  Can someone advise how this is accomplished? 
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

Update:

I have figured out how to set up a custom php.ini on my Site5 server that increases max_execution_time from the default 30 secs to 60 secs. Will stand by to see if this solves the problem.

pjb@godiva
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

To summarize, here is what I have tried to resolve the problem of stylesheet.php causing internal server errors, alll to no avail:

1. Reinstalling CMSMadeSimple 1.41

2. Checking for errors in the css files that stylesheet.php is trying to load

3.  Changing from PHP 4.x to PHP 5.x

4. Increasing the memory allocated to PHP from 32M to 63M

5. Increasing max_execution_time from 30 to 60 secs

6. Contacting my hosting provider, who asserts that this is a programming error in the php application.

Again, I ask if anyone else has had this problem, and found a resolution for it. 

CMS is otherwise a great application, and I'd hate to have to abandon it because of this problem.

pjb@godiva
alby

Re: Stylesheet.php throwing internal server errors (500)

Post by alby »

pjb@godiva wrote: 4. Increasing the memory allocated to PHP from 32M to 63M

5. Increasing max_execution_time from 30 to 60 secs
Have you checked with phpinfo if php has new values?

Alby
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

The max_execution_time showed up as 60 sec via phpinfo.

However, memory_limiit still showed up as 32M.  This surprised me because  the "System Information" page under the CMSMadeSimple Site Administration tab was showing PHP_memory_limit as 64M, so I had thought that was OK.

I've now changed php.ini to set memory_limit equal to 64M and that now shows up correctly in phpinfo.  Let's see if this fixes the problem.

pjb@godiva
pjb@godiva
Forum Members
Forum Members
Posts: 12
Joined: Mon Sep 22, 2008 4:38 pm

Re: Stylesheet.php throwing internal server errors (500)

Post by pjb@godiva »

Update:

Increasing memory_limit to 64M did NOT solve the problem, which is probably not surprising given that the core dump files I'm getting were only in the 5-7M range to begin with.

I'm running the same CMS configuration  and website on a development server that's just on my local network.  This has never given a core dump associated with stylesheet.php, despite being configured for 32M of PHP memory.

My hosting service -- Site5 -- insists that the problem is with something in CMSMadeSimple. Could it be a server configuration issue on their end? If so, what? I don't know enough about hosting to rebut their claim that the problem has to be with CMSMadeSimple.

Any other ideas?
Pierre M.

Re: Stylesheet.php throwing internal server errors (500)

Post by Pierre M. »

Pierre M. wrote: "Of the importance of the http error log"... ;)
Post Reply

Return to “CMSMS Core”