Sunday 16 November 2014

How to Install php gearman on ubuntu 14.04 and 14.10


Steps


1. Install the gearman job server and libgearman :

sudo apt-get install gearman-job-server libgearman-dev
2. Install the pecl extension

sudo apt-get install php-pear php5-dev
sudo pecl install gearman

The output will show something like this at the end :
Build process completed successfully
Installing '/usr/lib/php5/20100525/gearman.so'
install ok: channel://pecl.php.net/gearman-1.0.2
configuration option "php_ini" is not set to php.ini location
You should add "extension=gearman.so" to php.ini

3. Edit php.ini file :
$ locate php.ini
/etc/php5/apache2/php.ini
/etc/php5/cgi/php.ini
Open the correct php.ini file and add extension=gearman.so at the end.

4. Restart apache

How to install Mongodb in Lampp Ubuntu 14.10


Install MongoDB


Configure Package Management System (APT)

The Ubuntu package management tool (i.e. dpkg and apt) ensure package consistency and authenticity by requiring that distributors sign packages with GPG keys. Issue the following command

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

Create a /etc/apt/sources.list.d/mongodb.list file using the following command

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

Now issue the following command to reload your repository:

sudo apt-get update

Install Packages

Issue the following command to install the latest stable version of MongoDB:

sudo apt-get install mongodb-10gen


Install MongoDB PHP Driver to Lampp

Note that if you install XAMPP using the new .run installer file (versions newer than 1.8.3) then you will get the option during setup to install the development files as well as the core files. Remember to select both.

1 Please download lattest xampp for ubuntu and install with following command:

cd Download ( where xampp download location)
sudo chmod +x xampp-linux-1.8.3-4-installer.run
sudo ./xampp-linux-1.8.3-4-installer.run


 2. Run the pecl installer
1
sudo /opt/lampp/bin/pecl install mongo

Note : If You getting below error : “ ERROR: `phpize' failed”

sudo apt-get install php5-dev

Now again run this command :

sudo /opt/lampp/bin/pecl install mongo

Note : again any error same like

the error message you got:
configure: error: sasl.h not found!
should be solveable by:
sudo apt-get install libsasl2-dev
3. Finally add the following to the php.ini file (located in /opt/lampp/etc folder)
1
extension=mongo.so
4. restart xampp server

1
sudo /opt/lampp/lampp start
That’s it!