How To Install PHP5, Apache2, MySQL for UBUNTU
Install Apache2, PHP, MySQL
@ANHVNSE02067 - www.nhatanh.net - anhvnse@gmail.com
----------------------------
# Add repository
$ sudo apt-get install python-software-properties
$ sudo add-apt-repository ppa:ondrej/php5-oldstable
$ apt-get update
# Install Apache2
$ sudo apt-get install apache2
#Install Lastest stable PHP
$ sudo apt-get install php5 libapache2-mod-php5
# Install PHP modules
$ sudo apt-get install php5-mysql php5-curl php5-gd php5-intl php-pear php5-imagick php5-imap php5-mcrypt php5-memcache php5-ming php5-ps php5-pspell php5-recode php5-snmp php5-sqlite php5-tidy php5-xmlrpc php5-xsl
# Install MySQL
$ sudo apt-get install mysql-server mysql-client
# Install PHPMyAdmin
$ sudo apt-get install phpmyadmin
#FIX Cannot adopt OID in UCD-SNMP-MIB:
sudo apt-get install snmp-mibs-downloader
#FIX phpmyadmin not found
Add the following line to the end of /etc/apache2/apache2.conf:
Include /etc/phpmyadmin/apache.conf
Restart Apache by running:
#FIX mcrypt is missing
cd /etc/php5/apache2/conf.d
sudo ln -s ../../conf.d/mcrypt.ini 30-mcrypt.ini
sudo service apache2 restart
#INstall Mcrypt
cd /etc/php5/mods-available
ln -sf ../conf.d/mcrypt.ini .
php5enmod mcrypt
# Install php code sniffer
$ sudo pear install PHP_CodeSniffer
# -- follow this: https://github.com/klaussilveira/phpcs-psr
# -- ALT: https://github.com/ANHVNSE02067/phpcs-psr
# Install php mess detector
# Install PHP Depend http://pear.pdepend.org/
# Instal PHP_PMD http://pear.phpmd.org/
# Config PHP_PMD: /usr/share/php/data/PHP_PMD/resources/rulesets/
# Common commands