[PHP] Configuration php.ini

As I said in my blog, it is just a place to remind me the technology that I used everyday, there will be nothing so profound but useful in daily work.

This blog will present a simple schema for the configuration of the php.ini. There are several php.ini after installed php, it is very easy to be confused.

Continue reading

Advertisements

[Apache] Install configuration perl and php for apache

To install the configuration of perl and php for apache in Ubuntu, it is sufficient to execute several commands.

For perl : sudo apt-get install apache2

For php : sudo apt-get install php5 libapache2-mod-php5

After doing these commands, if we check whether the modules are avaliable, we just need a short script :

check_mod(){
    mode=$1
    mods_enabled=/etc/apache2/mods-enabled
    mods_available=/etc/apache2/mods-available

    if [ -f "$mods_enabled/$mode" ] ; then
    echo "The module $mode is enabled"
    else  
    if [ -f "$mods_avalable/$mode" ] ; then
        echo "The module $mode is available"
        sudo ln -s $mods_available/$mode $mods_enabled/$mode
    else  
        echo "[KO]The module is not installed[KO]"
    fi
    fi
}

check_mod perl.load
check_mod php5.conf
check_mod php5.load

Ref.
https://help.ubuntu.com/10.04/serverguide/php5.html
http://www.blog.highub.com/perl/install-configure-apache-localhost-perl-on-linux-ubuntu/