How to install PHP GeoIP in Ubuntu

This instructions will install GeoIP over Ubuntu. It is tested over Ubuntu 12.04 LTS.

I assume you already have PEAR/PECL available. I am using the CentOS’s stock PHP. First you need to update your channels:

Continue reading “How to install PHP GeoIP in Ubuntu”

How to install APC in Ubuntu 12.04

This installation is through PEAR. You can install it in other methods too. This has installed APC 3.1.9 for me over Ubuntu 12.04 LTS.

[code lang=”bash”]sudo apt-get install build-essential libpcre3-dev php5-dev
sudo pear update-channels
sudo pecl install apc[/code]

Continue reading “How to install APC in Ubuntu 12.04”

How to setup PHP Pear in Mac OS X Lion

Here’s how to install PHP Pear in Mac OS X Lion 10.7 using the Apache/PHP install that comes with XCode.

Once you have PHP set up, you need to run the following installer:

[code lang=”php”]
kahwee-mba:Volumes kahwee$ sudo php /usr/lib/php/install-pear-nozlib.phar
[PEAR] Archive_Tar – installed: 1.3.7
[PEAR] Console_Getopt – installed: 1.3.0
[PEAR] Structures_Graph- installed: 1.0.4
[PEAR] XML_Util – installed: 1.2.1
[PEAR] PEAR – installed: 1.9.2
Wrote PEAR system config file at: /private/etc/pear.conf
You may want to add: /usr/lib/php/pear to your php.ini include_path

If your php.ini is in /etc/php.ini, open it using:

[code lang=”bash”]sudo nano /etc/php.ini[/code]

Should the file no exist, you may want to copy the configuration for /etc/php.ini.default over by doing the following:

[code lang=”bash”]sudo cp /etc/php.ini.default /etc/php.ini[/code]

Finally you will need to update the paths in your include_path in your php.ini:

[code lang=”php”]

; Paths and Directories ;

; UNIX: “/path1:/path2”
include_path = “.:/php/includes:/usr/lib/php/pear”

After this, you can install PHP Pear packages. This is used if you want to install Numbers_Words package:

[code lang=”bash”]sudo pear install channel://[/code]

Have fun.

How to install PHPUnit using PEAR

One of the ways to install PHPUnit is through PHP Pear. You must already have PHP Pear installed. This is verified to work on Mac OS X Snow Leopard.

To install PHPUnit through PHP PEAR, the following channels have to be added before an install:

[code lang=”bash”]pear channel-discover
pear channel-discover
pear channel-discover
pear install phpunit/PHPUnit[/code]

Try running:

[code lang=”bash”]phpunit –version[/code]

You should see the following response:

[code lang=”bash”]PHPUnit 3.5.0 by Sebastian Bergmann.[/code]

How to install PEAR modules using XAMPP

This guide aims to go through installation of PEAR modules using XAMPP. The module to install is MDB2.

I use XAMPP Lite instead of the full XAMPP but I imagine it to be the similar. My platform is Windows Vista.

0. Objective

To install PEAR module, MDB2, using a XAMPP set up. Also install the MySQL, MySQLi and PostgreSQL drivers.

1. Setting up environment variables

Continue reading “How to install PEAR modules using XAMPP”