Showing posts with label php. Show all posts
Showing posts with label php. Show all posts

Friday, August 20, 2010

php-cgi.exe exceeds the current memory limitation

Problems:
Memory on php-cgi runs out when executing php-scripts.
Formula for Instances:

Ideal Instances: (TotalMemory in GB/Instances) < 2

Recommended Instances: (TotalMemory in GB / Instances) < 1

If you are using IIS or apache check for the following parameters which affects the performance of php,

These are settings in
php.ini Settings:
session.gc_probability = 1
session.gc_divisor     = 100
session.gc_maxlifetime = 14400 - After 4 hours it resets all the Garbage collected Data.


Web Server Settings:

NumberofRequest Per Instance
MaxRequests for the CGI
Maximum Number of Instances

It works charm with distributed memory on the distributed instances.

Sunday, August 8, 2010

Warning: Cannot modify header information - PHP error on packages - Solved

Warning: Cannot modify header information

You can resolve this error in three ways. This recently happened on a plain vannila wordpress install just modifying the wp_config.php in windows. The file encoding got changed to UTF (With BOM).

As a normal user if you are just installing the package or if you edited a file then this is purely a encoding problem on the file.

Use editor like notepad++ and change the encoding of the file (Encoding Menu) to ANSI or if the File is in UTF-8  then encode in Encode in UTF-8 Without BOM. This should resolve the problem.

If you are developer having code problem,

  1. Chances you have space or empty lines or characters going out of your code before the
  2. Use ob_start(); function. If you cannot control the output then use ob_start(); function at top the page, then your problem of "modify header" will be resolved. ob_start() is output controlling function. This is an urgent way of fixing it but not a clean way.


Hope this helps.

Friday, March 26, 2010

Cache on IIS 7 with SugarCRM Windows Server 2008

If you are planning to run Cache enabled on SugarCRM with II7 then you will face weird issues. IIS caches the php pages and serve the same content to different users. With that you can see other person's userid on your pages, that is not coming from SugarCRM that is coming from IIS Cache.

It happened in Windows 2008 Server.

The only option as of now is to disable IIS Cache so all pages will be generated directly from php.