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.

Thursday, August 19, 2010

How to find whether a mail is sent or Received?

I was thinking of a way to find whether an email in a folder whether it is Sent or Received mails. It may happen through any of the existing protocol (POP3, IMAP).

Check for "Received" header in the email headers. If you have values on the received headers then it is a Sent Email otherwise it is a received email to that mailbox.

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.

Wednesday, August 4, 2010

SugarCRM Relationship Error - Solved

Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in E:\SugarCRM\modules\Relationships\Relationship.php

If you get error like this means your cache is having a problem. Delete all the files and rebuild the cache twice. It is also wise to copy the cache directory from a working SugarCRM instance and rebuid the cache twice.

Enjoy.

Tuesday, June 8, 2010

IPhone 4 - 3G - SIP

I'm using iphone right from the first generation. Somehow apple made a nice user interface which is much appreciated. Eventhough it still needs reboot like windows after using sometimes.

One thing much appreciable about the 4th Version is the open standard. HTML5 and the SIP. With SIP it must be easily interoperable with many services and easier to extend the services to enterprise market. Extending SIMPLE to Iphone 4, also let know about the presence of the user before we call them. So we can avoid voicemails and hit calling them. We can also make automated relaxed call as soon as the other person is available.

I foresee Mobileme will bring video from iphone and you should be able to watch Iphone video from Browser through your http connection. No extras fittings.


Thanks to Endgadget for the photo.

Nice list with the nice interface.

H.264 & AAC is the codec
SIP - Session Intiation Protocol
STUN - Session Traversal Utilities for NAT
TURN - Traversal Using Relay NAT
ICE - Interactive Connectivity Establishment
RTP - Realtime Protocol
SRTP - Secure RealTime Protocol

Also on my dreams I should be able to have more than one phone number for my mobile. With these technologies you have any country phone number to your mobile. Providers such as localphone are readily available on Open Standards to connect with them.

Thanks to Jeff Pulver for creating me interests on these technologies. He made me to make the first VoIP Call to Newyork, USA from London, United Kingdom in 2002. Kudos to Steve Jobs for making the nice graphics workable box again.

Sunday, April 11, 2010

Cisco 7960 Funny Bugs on SIP Proxy changed through keypress

During the recent upgrade I was about to change my network topology and separate it into different networks. I need to get my SIP Proxy also changed. I changed in the phone manually and rebooted the phone to take effect. Funny 7960 saved all the settings and did not connect to the SIP Proxy. Checked with Wireshark and checked all the packets around, found it is still looking for previous SIP Proxy server.

Easiest way to check the 7960 phone is to telnet into it with ("cisco") as default password. type "show network" to know more about the network configuration of the phone.Changed the alternate tftp server to "Yes" the changed the tftp server. (God, atleast this works.).

Gets is configuration from the configuration file through tftp and went on smoothly from there.
It is another bug which makes the user to mess around with the phone. Poor regression testing from Cisco again.

Enjoy with the phone.

17 Steps to Openwrt Setup With Asterisk 1.4 on WRTSL54GS or Similar Routers - 30 Minutes

This is my recent experience in getting Asterisk 1.4 on WRTSL54GS routers. It is much easier than my previous installations on the routers.

We will go from the scratch in getting the router running in Openwrt and in Asterisk.


Step 1: Select the right image of Openwrt for your router.
Step 2: Telnet into the router with root and empty password.
Step 3:  Change password with passed command and exit.
Step 4: Login to router with SSH login.
Step 5: Install the latest Stable webif(2) from xwrt.
Step 6: Reboot and Login to router from the browser. (This is to tweak some settings if you want)
Step 7:  ipkg install  kmod-usb-uhci kmod-usb2 kmod-usb-storage kmod-ext3 fdisk e2fsprogs
Step 8: Format the external USB Disk to ext3 file system you don't need multipartition, single partition is enough.
Step 9: Attach usb disk to the router
Step 10: Mount the USB Disk to /opt directory. Even if it is already automounted to different directory you can mount it to different directory too. Use the following command to do it.
           mount -t ext3 -o noatime /dev/scsi/host0/bus0/target0/lun0/part1 /opt & Add it to the Startup script using the webif from browser.
Step 11: Reboot.
Step 12: Let us install additional softwares to the USB Disk. Poor manufacturers gave us with only MB of memory in the routers. Let us add 2GB of data to it. :)
Step 13: wget http://www.3iii.dk/linux/optware/optware-install-ddwrt.sh -O - | tr -d '\r' > /tmp/optware-install.sh
Step 14: sh /tmp/optware-install.sh
Step 15: Let us install asterisk and additional voice files to
               /opt/bin/ipkg-opt install asterisk14-core-sounds-en-alaw asterisk14-core-sounds-en-g729 asterisk14-core-sounds-en-gsm asterisk14-core-sounds-en-ulaw asterisk14-extra-sounds-en-alaw asterisk14-extra-sounds-en-g729 asterisk14-extra-sounds-en-gsm asterisk14-extra-sounds-en-ulaw asterisk14-moh-freeplay-alaw asterisk14-moh-freeplay-g729 asterisk14-moh-freeplay-gsm asterisk14-moh-freeplay-ulaw asterisk14 asterisk14-gui libogg radiusclient-ng sqlite2 unixodbc iksemel net-snmp

Step 16: To the Startup Script Mount the USB Disk and startup asterisk.

/opt/etc/init.d/S99Asterisk:
#!/bin/sh
if [ -f /opt/var/run/asterisk.pid ] ; then
  kill `cat /opt/var/run/asterisk.pid`
else
  killall asterisk
fi
rm -f /opt/var/run/asterisk.pid
umask 077
/opt/sbin/asterisk

Step 17: Configure your voip clients and Start Making Calls.