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 install PHP GeoIP in CentOS

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

[code lang=”bash”]kahwee:~ kahwee$ sudo pear update-channels
Updating channel “doc.php.net”
Channel “doc.php.net” is up to date
Updating channel “pear.php.net”
Channel “pear.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date[/code]

Continue reading “How to install PHP GeoIP in CentOS”

How to install PHP APC in CentOS

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

[code lang=”bash”]kahwee:~ kahwee$ sudo pear update-channels
Updating channel “doc.php.net”
Channel “doc.php.net” is up to date
Updating channel “pear.php.net”
Channel “pear.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date[/code]

Continue reading “How to install PHP APC in CentOS”

How to install PHP APC in OS X

I assume you already have PEAR/PECL available. I am using the Mac OS X PHP environment that is provided by Apple’s XCode but it shouldn’t matter how you get your PHP. First you need to update your channels:

[code lang=”bash”]kahwee:~ kahwee$ sudo pear update-channels
Updating channel “doc.php.net”
Channel “doc.php.net” is up to date
Updating channel “pear.php.net”
Channel “pear.php.net” is up to date
Updating channel “pecl.php.net”
Channel “pecl.php.net” is up to date[/code]

Continue reading “How to install PHP APC in OS X”

How to install PHP APC through PEAR

If you try to install PHP APC 3.1.5 through PHP PEAR and encounter errors regarding phpize or the following:

[code lang=”bash”]/usr/include/php5/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory[/code]

…well don’t worry. You’re missing a few components. For phpize, you’ll need the php5-dev that you can fetch from Ubuntu. For the php_prce.h error, you’ll need pcre3-dev package which is essentially Perl 5 Compatible Regular Expression Library – development files.

Perform the following and install PHP APC using PECL again:

[code lang=”bash”]sudo apt-get install libpcre3-dev php5-dev
sudo pecl install apc-3.1.5[/code]

And it’s done:

[code lang=”bash”]Build process completed successfully
Installing ‘/usr/lib/php5/20090626+lfs/apc.so’
install ok: channel://pecl.php.net/APC-3.1.5
configuration option “php_ini” is not set to php.ini location
You should add “extension=apc.so” to php.ini[/code]

This is tested against Ubuntu 10.04 as well as Ubuntu 10.10 environments.

You can add it to /etc/php5/conf.d/apc.ini by:

[code lang=”bash”]nano /etc/php5/conf.d/apc.ini[/code]

Add in the following codes:

[code lang=”php”]
extension=apc.so
apc.enabled=1
apc.shm_segments=1
apc.shm_size=32M
apc.cache_by_default=1
apc.stat=1
apc.rfc1867=1 //For Drupal upload progress.
apc.stat=7200 //2 hours
[/code]