Archive for the ‘PHP’ Category

Disable php for single hosting account.

We can disable the php for single hosting account by using following code in .htaccess file. php_value engine off  

Send mail by using phpmail function.

You can create a simple php mail form by using following code.. ————————– <? $to      = ‘supp0rt@xyz.com’; $subject = ‘The test for mail function’; $message = ‘Hello’; $headers = ‘From: test@abc.com’ . “\r\n” . ‘Reply-To: test@testforever.com’ . “\r\n” . ‘X-Mailer: PHP/’ . phpversion(); mail($to, $subject, $message, $headers); ?> ————————– If you are not able to […]

How to parse php pages in html page?

You can use following code in .htaccess file to parse php pages in html pages RemoveHandler .html .htm AddType application/x-httpd-php .php .htm .html To can check above code is working ir not? by creating one test page with following code root@gunjan[~]#pico test.html < html> < head> < body> < h1> < ?php echo “WORKING FINE!”; […]

JoomlaFCK editor is not working?

Some time JoomlaFCK editor is not allowing to add any text after installing Joomla. Refer following steps to sort out the JoomlaFCK problems. Open configuration.php file and replace following line From var $live_site = ‘http://domain.com’; To var $live_site = ‘http://www.domain.com’; thats all.  

Alternative PHP cache (APC)

Alternative PHP Cache (APC) is a PHP extension for caching data and compiled code from php accelerator. It helps to improve the performance of the webserver. The steps to install APC in cpanel are as follows: # cd /usr/local/src Get the latest version of APC, # wget http://pecl.php.net/get/APC-3.0.14.tgz # tar -zxvf APC-3.0.14.tgz # cd APC-3.0.14 […]

Adding PHP RSS feeds to your website

RSS means Really Simple Syndication. This is used to publish frequently updated content such as blog entries, news headlines etc. An RSS document or a “feed” contains a summary of content from an associated web site. Adding RSS feeds to your web pages with PHP will provide fresh content for the search engines to give […]

PHP scripts giving 500 Internal Server Errors and apache error log shows FATAL: erealloc()”

“PHP scripts giving 500 Internal Server Errors and apache error log shows the error as follows:” PROBLEM FATAL:  erealloc():  Unable to allocate 37581 bytes [Mon Apr 14 19:07:39 2008] [error] [client 125.17.242.245] Premature end of script headers: /home/username/public_html/site/index.php SOLUTION  The cause of the problem is because of the line “RLimitMEM 22369621” in httpd.conf file.commented out […]

How to enable runkit PHP extension

Installing runkit PHP extension. #cd /usr/local/src #wget http://pecl.php.net/get/runkit-0.9.tgz #tar -zxvf runkit-0.9.tgz #cd runkit-0.9 #phpize #./configure #make After running the make command you will get the following error. /usr/local/src/runkit-0.9/runkit_import.c: In function ‘php_runkit_import_class_props’: /usr/local/src/runkit-0.9/runkit_import.c:230: warning: passing argument 2 of ‘zend_unmangle_property_name’ makes integer from pointer without a cast /usr/local/src/runkit-0.9/runkit_import.c:230: error: too few arguments to function ‘zend_unmangle_property_name’ make: *** […]

Php memory size exhausted error

If you are getting a php Fatal error like Fatal error: Allowed memory size of 20971520 bytes exhausted at /usr/ports/lang/php5/work/php-5.2.1/Zend/zend_hash.c:1036 (tried to allocate 232 bytes) in /home2/webofunni/www/mediawiki-1.10.1/includes/SpecialPage.php on line 784 Then error is because of small memory limit in php. Try to increase php memory limit by following method . 1. Add following line to […]

Install php5 and php4 in cPanel server

Now php has flushed their support for php4. Now most of the sites are loading under php5. But traditional php sites won’t work under php5. So we have to have php5 as primary and php4 as secondary php. Previously it was php4 as default and php5 as secondary, but now it is in the other […]