Can't view the calender

drbowen wrote on Monday, March 03, 2008:

I am getting a lot or error messages after upgrading the PHP, Apache, MySQL.  I think this may be due to some error messages that were referred to just as we released 2.8.3 having to due with PHP5 being stricter than PHP4 at catching certain syntactical errors.

OpenEMR 2.8.2-dev (just before the 2.8.3 release)
mysql-5.0.54
apache-2.2.8
php-5.2.5-r1
mod_ssl/2.2.8
OpenSSL/0.9.8g

Error:

File does not exist: /var/www/localhost/htdocs/openemr/interface/main/calendar/images, referer: http://teach/openemr/interface/main/calendar/index.php?module=PostCalendar&viewtype=day&func=view&pc_username=drbowen

The OpenEMR server was doing OK when we first started it up but after a few hours of operation we can no longer see the calender.

Does anyone recognize this error message?

Sam Bowen, MD

sunsetsystems wrote on Monday, March 03, 2008:

Don’t know about that error message, but check over your php.ini.  It sounds like you are running out of memory for the scripts - the default setting is not usually enough.  Some settings that I commonly use:

allow_call_time_pass_reference = On
max_execution_time = 60
max_input_time = 90
memory_limit = 40M
error_reporting  =  E_ALL & ~E_NOTICE
magic_quotes_gpc = On
upload_max_filesize = 8M
session.gc_maxlifetime = 14400

Rod
www.sunsetsystems.com

drbowen wrote on Monday, March 03, 2008:

Thanks Rod for the input.

Old:

allow_call_time_pass_reference = On
max_execution_time = 60
max_input_time = 90
memory_limit = 128M
error_reporting = E_ALL & ~E_NOTICE
magic_quotes_gpc = On
upload_max_filesize = 2M
session.gc_maxlifetime = 14400

New

allow_call_time_pass_reference = On
max_execution_time = 60
max_input_time = 90
memory_limit = 128M
error_reporting = E_ALL & ~E_NOTICE
magic_quotes_gpc = On
upload_max_filesize = 8M
session.gc_maxlifetime = 14400

I have restarted Apache and currently the code is working normally.

It doesn’t seem to me that:

upload_max_filesize = 2M

would cause this.  Is there some other setting, that might explain this behavior?

Sam Bowen, MD

sunsetsystems wrote on Monday, March 03, 2008:

You might create a “<?php phpinfo() ?>” script amd make sure the php.ini that you configured is the same one that’s being used.  Also browse the output for anything that seems wrong.

Rod
www.sunsetsystems.com

drbowen wrote on Monday, March 03, 2008:

The php.ini path in phpinfo.php is correct.

The rest of the output (within my limited ability) appears OK.

Sam Bowen, MD

drbowen wrote on Tuesday, March 04, 2008:

Could this be from the Apache upgrade?  Gentoo has implemented the Apache MPMs.

http://httpd.apache.org/docs/2.0/mod/worker.html

******
Summary

This Multi-Processing Module (MPM) implements a hybrid multi-process multi-threaded server. By using threads to serve requests, it is able to serve a large number of requests with less system resources than a process-based server. Yet it retains much of the stability of a process-based server by keeping multiple processes available, each with many threads.
******

The description on the Gentoo Wiki describes this as the greatest thing on "well behaved" web sites.  They then describe the web-behaved behavior but no trouble shooting in case you happen to have a "non well behaved site."

Run away threads are a problem for PHP and may be affecting the Calender module (and my database storage of images).

What do think Rod?

Sam Bowen, MD

sunsetsystems wrote on Tuesday, March 04, 2008:

Last I heard, PHP requires the "prefork" MPM.  The multi-threading MPMs are not compatible with it because PHP uses libraries that are not thread-safe.  So yeah, that might be your problem.

Rod
www.sunsetsystems.com

drbowen wrote on Tuesday, March 04, 2008:

Interestly the Gentoo community feels that PHP is generally thread safe and the default or recommended "USE" variables include "threads" for both the Apache and PHP.  Using the "threads "USE" variable causes the MPM-worker module to be installed. 

This is mutually exclusive with the mpm_prefork_module.  I am pretty confident that the Calender is not thread safe and apparently the code that I wrote for the image - documents database uploading routine is not.

I have removed the "threads" "USE" variables from /etc/portage/package.use and added "mpm-prefork" to the APACHE2_MODULES.  I will recompile Apache and report back.

Sam Bowen, MD

drbowen wrote on Tuesday, March 04, 2008:

A-HAH!

A recompile of PHP just complained that I do not have any of the PHP safe MPM modules.  The error message states that only

itk
peruser
prefork

will work with PHP.

Sam Bowen, MD

drbowen wrote on Tuesday, March 04, 2008:

After removing "threads" from the pakage.use and adding "mpm_prefork_module" to the Apache "USE" variables, then recompiling we have not had any more issues.  We have been up significantly longer than previously.  Initially this looks like this solved this problem.

Sam Bowen, MD 

sunsetsystems wrote on Tuesday, March 04, 2008:

So perhaps "well behaved" means "not for the real world".  :slight_smile:

Rod
www.sunsetsystems.com