PHP run as Apache Module (mod_php)
Add this to your root .htaccess file. Say your php.ini is in folder /askapache.com/ini/
SetEnv PHPRC /askapache.com/ini
php, ajax, mysql, javascript, javascripts, linux, apache, lamp, html, dhtml, xml, xhtml, SEO, web2.0, optimization, useful links, PHP tips, Mysql tips, Apache, .htaccess, benchmarking
SetEnv PHPRC /askapache.com/ini
# 1 YEAR
Header set Cache-Control "max-age=29030400, public"
# 1 WEEK
Header set Cache-Control "max-age=604800, public"
# 2 DAYS
Header set Cache-Control "max-age=172800, proxy-revalidate"
# 1 MIN
Header set Cache-Control "max-age=60, private, proxy-revalidate"
# any Expires Directives go here
# any Header directives go here
At least one of the 2 modules needs to be built into Apache; although they are included in the distribution, they are not turned on by default. To find out if the modules are enabled in your server, find the httpd binary and run httpd -l; this should print a list of the available modules. The modules we're looking for are mod_expires and mod_headers.
If they aren't available, and you have administrative access, you can recompile Apache to include them. This can be done either by uncommenting the appropriate lines in the Configuration file, or using the -enable-module=expires and -enable-module=headers arguments to configure (1.3 or greater).
Complete Article