ANIL KUMAR PANIGRAHI 's Blog

Few things about PHP

Posted by: Anil Kumar Panigrahi in: ● June 15, 2010

Hi friends,

Below things are very useful when we develop websites using php code.

1) To check pear package is installed in your server or not.

<?php
require_once ‘System.php’;
var_dump(class_exists(‘System’));
?>
It will give information about pear package in our server.
2) Add php code in a htm file.
When i was working in website, in that website php code is written in a static htm file. For that we just put a one line code in a .htaccess file, it will work.
AddHandler application/x-httpd-php .html .htm
3) To display warnings in php file
After hosting files into a new server, it does not give output, it shows empty page, because that files contains warnings. In a server default warnings are disable, to enable those warnings add below code in a starting of php file.
ini_set(‘error_reporting’, E_ALL ^ E_NOTICE);
ini_set(‘display_errors’,1);
4) Warning : header already sent or cannot modify header information
This warning mainly occurs when there is white space before the header location or some echo statements before the header location. So better prevent echo and white spaces before the header statement this warning will prevented.
Share on Twitter

1 Comment to "Few things about PHP"

Write Comment

About Me

  Anil Kumar Panigrahi
  Software Engineer (PHP)
  Blogger & Founder of Anil Labs
  Baruva, India

You can share with me . . .

My Own Contributions

1) First contribution for codeigniter framework ( multi language support using google translate API ). we can get files from http://github.com/nyros/codeigniter_multilanguage


2) Audio and Video Streaming using FFMpeg and PHP -complete doc file : http://www.docstoc.com/docs/8300349/Audio-and-Video-Streaming

Twitter Updates

Follow me @anil2u
  • http://www.google.co.uk/ logo is changing with mouse move . . . - posted on 07/09/2010 10:57:33
  • True enemies are real friends . . . - posted on 06/09/2010 10:15:29
  • Just watched nice movie " Madrasapattinam ". - posted on 05/09/2010 16:20:48
  • We will always be thankful to our teacher for all the hard work and efforts they have put in, for educating us.- Happy teachers Day . . . :) - posted on 05/09/2010 05:39:13
  • Working on shipping cost functionality (UPS and USPS) for oscommerce shopping cart - posted on 01/09/2010 09:40:03