PHP

From Indie IT Wiki
Jump to: navigation, search

PEAR

Installation

sudo apt-get install php-pear

Error: requires PEAR Installer

requires PEAR Installer (version >= 1.10.1), installed version is 1.9.4

The fix is below...

Upgrade

sudo -i
pear upgrade --force --alldeps http://pear.php.net/get/PEAR-1.10.1
pear clear-cache
pear update-channels
pear upgrade
pear upgrade-all

Thanks - https://superuser.com/a/1129953/287000

HOWTO: Secure Tighten PHP

sudo nano /etc/php5/apache2/php.ini /etc/php5/cgi/php/ini

Change the following lines as the following :

display_errors = Off
log_errors = On
allow_url_fopen = Off
safe_mode = On
expose_php = Off
enable_dl = Off
disable_functions = system, show_source, symlink, exec, dl, shell_exec, passthru, phpinfo, escapeshellarg, escapeshellcmd

Thanks - http://secure-ubuntu-server.blogspot.co.uk/2009/07/howto-hardening-your-apache-and-php-on_07.html

HOWTO: Upgrade To PHP 5.5 On Ubuntu 12.04 LTS

sudo add-apt-repository ppa:ondrej/php5
sudo aptitude update
sudo aptitude -v -s safe-upgrade
sudo aptitude -v -y safe-upgrade
php --version

Thanks - https://joshtronic.com/2013/12/30/upgrade-php-5-3-php-5-5-ubuntu-12-04-lts/

HOWTO: Upgrade PHP 5.3 To PHP 5.4 On Ubuntu 12.04 LTS

sudo add-apt-repository ppa:ondrej/php5-oldstable
sudo aptitude update
sudo aptitude -v -s safe-upgrade
sudo aptitude -v -y safe-upgrade
php --version

Thanks - http://www.nicovs.be/install-php-5-4-on-ubuntu-12-04-lts

HOWTO: Install Extensions

Centos

pecl install zip