SEARCH
TOOLBOX
LANGUAGES
PHP

PHP

From GarrettHoneycutt

Jump to: navigation, search

Contents

Show compiled in modules

$ php -m

Show information

$ php -i

Manage with Puppet

# 
# A class to install mod_php for apache
#
class apache::php {
    include apache
 
    package { "php":
        ensure  => installed,
    }
 
    apache::module{"php": 
        source => "puppet:///apache/php.conf",   
    }
 
    # used to install a php.ini
    # called from some class that needs a special php.ini such as:
    # apache::php::conf { "mywebapp": source => "puppet:///mywebapp/php.ini", }
    define conf ( $source ) { 
       file { "/etc/php.ini":
           source  => $source,
           require => [ Class["apache"], Package["php"] ],
           notify  => Service["apacheService"];
       } # file
    } # define
} # class apache::php

default php.conf for apache

#
# PHP is an HTML-embedded scripting language which attempts to make it
# easy for developers to write dynamically generated webpages.
#
 
LoadModule php5_module modules/libphp5.so
 
#
# Cause the PHP interpreter to handle files with a .php extension.
#
AddHandler php5-script .php
AddType text/html .php
 
#
# Add index.php to the list of files that will be served as directory
# indexes.
#
DirectoryIndex index.php
 
#
# Uncomment the following line to allow PHP to pretty-print .phps
# files as PHP source code:
#
#AddType application/x-httpd-php-source .phps

Cheat Sheet

Image:Php-cheat-sheet-v2.png