Magento installation error "Unable to allocate memory for pool"

Recently, I worked on a Magento project which had this error message when installing Magento on the client's server.

Warning: include_once() [function.include-once]: Unable to allocate memory for pool. in /var/www/vhosts/httpdocs/app/Mage.php on line 49

After spending time to search for a solution, I realized this is a problem which is related to PHP configure. I think the PHP configuration does not meet Magento system requirement. To fix the issue, you need to disable APC (Alternative PHP cache) in your server.
There is an easier way that you can simply add this line to .htacccess file in the root folder of you Magento site.

php_flag apc.cache_by_default Off

The error should be gone now. However, I am not sure this is a good way to do. Anyone has a better solution, please provide.