MongoDB Install Error - mongodb

Just setup a fresh server at MediaTemple (dedicated virtual / CentOS Linux) and installed the developer tools, but Mongo won't install, any ideas?
Also, it's trying to DL version 1.2.10 I assume I can run pecl upgrade mongo once it is installed to go to 2.0.6 right?
Here's my output:
[root ~]# pecl install mongo
downloading mongo-1.2.10.tgz ...
Starting to download mongo-1.2.10.tgz (86,463 bytes)
.....................done: 86,463 bytes
36 source files, building
running: phpize
Configuring for:
PHP Api Version: 20041225
Zend Module Api No: 20060613
Zend Extension Api No: 220060519
building in /var/tmp/pear-build-root/mongo-1.2.10
running: /root/tmp/pear/cache/mongo-1.2.10/configure
checking for egrep... grep -E
checking for a sed that does not truncate output... //bin/sed
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.
ERROR: `/root/tmp/pear/cache/mongo-1.2.10/configure' failed

You're not installing mongodb with pecl, here you're installing the PHP driver for mongodb.
To install mongodb on CentOS, please follow these instructions here. These instructions show you how to add the 10gen repo, which will then enable you (using yum) to install the latest production-ready mongodb release (2.0.6).
I realise that it's not Ubuntu but egarding your issue with installing the PHP driver, does it make any difference if you run
sudo pecl install mongo
There's some information here on installing the mongo php driver, just replace the 'apt-get' elements with 'yum' as the same libraries, dependencies apply afaik.
Here's a tutorial on using the mongo php driver.

Related

memcached Version 3.0.4 does not have REST xml available install failed

i follow a tutorial from plesk to install memcache(d), he say put this line:
/opt/plesk/php/7.2/bin/pecl install memcached
But this work not and i get this error:
Package "memcached" Version "3.0.4" does not have REST xml available
install failed
What i can do? Have any a how to for noobs? :-)
Best regards, Stefan
Can't reproduce this error. I have successfully compiled module with
yum install plesk-php72-devel gcc make libmemcached-devel
/opt/plesk/php/7.2/bin/pecl install memcached
libmemcached directory [no] : /usr

MongoDB php7 driver installation

I'm working on an Ubuntu 16 server and I can't seem to get the mongodb driver for php 7 to work. I installed it successfully on my xampp on my windows machine but Ubuntu and php7 seemingly have vast differences.
I did try to install it via pecl install mongodb and used composer to put in the dependencies but it still does not work. I'm using the same php file from my windows Xampp and when I access the page it throws a 500 status code.
Could someone provide a definitive walkthrough on how to install this driver and maybe also how to revert any changes I made using composer and pecl?
Cool even I tried with pecl but didn't work as expected. It work with pecl7 Also, I received this warning along with error, WARNING: "pecl/mongo" is deprecated in favor of "channel:///mongodb" pecl/mongo requires PHP (version >= 5.3.0, version <= 5.99.99), installed version is 7.1.8. Also, got 500 Internal server error.
Before that MongoDB php7 driver, I needed the memcache and getting phphize error that I solved using this repo. Then finally I use this low level PHP driver for MongoDB.
$ git clone https://github.com/mongodb/mongo-php-driver.git
$ cd mongo-php-driver
$ git submodule sync && git submodule update --init
$ /usr/bin/phpize
$ ./configure
$ make all -j 5
$ sudo make install
You can confirm from the output that mongodb.so driver is installed.
;;;;;;;;;;;;;;;;;;;
; Module Settings ;
;;;;;;;;;;;;;;;;;;;
extension=mongodb.so
Then only step remaining is make it available in your respective path. You can check your extensions_dir in php.ini with the following command,
$ php -i | grep extension_dir
extension_dir => /usr/lib64/php/7.0/modules => /usr/lib64/php/7.0/modules
And, I can verify that mongodb.so is present into the above directory. Then reload the composer and you are good to go ! Hope this helps as it work for me.

To make things right, you must install php_mongo module

I am not able to install the php mongo driver in a VPS. I've followed this and this documentantion
I checked this stack here but i can't figure out what I am doing wrong.
The VPS runs on PLESK 12 and CentOS 7.
lets say that I have the domain "mydomain.com" on my plesk and in mydomain.com/info.php a phpinfo script.
PHP INFO
PHP.ini
What amb I doing wrong?
The weird thing is that when I run the command "php -v" I get this output:
Which is not the version that is showing phpInfo.
Finally, I can't install the newest driver versions using pecl because I get the following error:
I would appreciate any help
Thanks!!
It's happens because you are call native OS binaries of php and pecl.
Plesk's PHP 5.6 binaries are stored in /opt/plesk/php/5.6/bin/. So you have to call /opt/plesk/php/5.6/bin/php and /opt/plesk/php/5.6/bin/pecl
Here full steps how to install mongodb for PHP 5.6:
[root#cos71x64-plesk12 ~]# /opt/plesk/php/5.6/bin/pecl install mongodb
/opt/plesk/php/5.6/bin/phpize not found. Run 'yum install plesk-php56-devel' to install it
[root#cos71x64-plesk12 ~]# yum install plesk-php56-devel
[root#cos71x64-plesk12 ~]# /opt/plesk/php/5.6/bin/pecl install mongodb
Build process completed successfully
Installing '/opt/plesk/php/5.6/lib64/php/modules/mongodb.so'
install ok: channel://pecl.php.net/mongodb-1.1.4
configuration option "php_ini" is not set to php.ini location
You should add "extension=mongodb.so" to php.ini
[root#cos71x64-plesk12 ~]# echo "extension=mongodb.so" > /opt/plesk/php/5.6/etc/php.d/mongodb.ini
[root#cos71x64-plesk12 ~]# /opt/plesk/php/5.6/bin/php --info | grep mongo
/opt/plesk/php/5.6/etc/php.d/mongodb.ini,
mongodb
mongodb support => enabled
mongodb version => 1.1.4
mongodb stability => stable
libmongoc version => 1.3.3
mongodb.debug => no value => no value

Installing memcached on CentOS 6

I have to admit to be fumbling in the dark here. I am fairly good at PHP but I know little or nothing about managing LINUX servers. I need to install memcached on my 64 bit CentOS 6 server and came across two very informative resources
http://boomshadow.net/tech/installs/how-to-install-memcached/
I followed the steps expained there and the memcached daemon is up and running on my server now. I still need to install the PHP extension for memcache so I tried the steps explained here
http://boomshadow.net/tech/installs/how-to-install-php-memcache/
Here is the output I get
[root#xxx ~]# pecl install memcache
WARNING: channel "pecl.php.net" has updated its protocols, use "pecl channel-update
pecl.php.net" to update
downloading memcache-3.0.8.tgz ...
Starting to download memcache-3.0.8.tgz (70,523 bytes)
.................done: 70,523 bytes
15 source files, building
running: phpize
Configuring for:
PHP Api Version: 20090626
Zend Module Api No: 20090626
Zend Extension Api No: 220090626
Enable memcache session handler support? [yes] : yes
building in /var/tmp/pear-build-rootZi8fyR/memcache-3.0.8
running: /var/tmp/memcache/configure --enable-memcache-session=yes
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for a sed that does not truncate output... /bin/sed
checking for cc... no
checking for gcc... no
configure: error: in `/var/tmp/pear-build-rootZi8fyR/memcache-3.0.8':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
ERROR: `/var/tmp/memcache/configure --enable-memcache-session=yes' failed
[root#xxx
I cannot make a secret of this - most of this is Greek to me. What I think I have figured out is that pecl is looking for a C compiler to build the PHP memcache driver from the downloaded source and cannot find it. Even if that is right it does not help me much.
Just what do I need to do here to get things working correctly.
Old habits die hard, I guess - answering my own question once again.
# yum groupinstall 'Development Tools'
to install development tools including the gcc compiler. The memcahe.so extension uses zlib so you also need to do
# yum install zlib-devel
if you came accross configure: error: no, sasl.h is not available. Run configure with --disable-memcached-sasl to disable this check
ERROR: /var/tmp/memcached/configure --with-libmemcached-dir=no' failed
./configure --enable-memcached-sasl=no
make
make install
pecl install memcached

Perl DBD::Oracle Module installation

Could someone guide me how to install the Perl DBD::Oracle module?
Here is what I have done so far:
Platform: RHEL 5.8 64 bit
Installed Perl DBI package
Installed Oracle Instant client for Linux 64 bit (basi + sdk + sqlplus component for the instant client
Have set the correct $ORACLE_HOME and $LD_LIBRARY_PATH
Then when I do perl Makefile.pl it fails with the following error:
I'm having trouble finding your Oracle version number... trying harder
WARNING: I could not determine Oracle client version so I'll just
default to version 8.0.0.0. Some features of DBD::Oracle may not work.
Oracle version based logic in Makefile.PL may produce erroneous results.
You can use "perl Makefile.PL -V X.Y.Z" to specify a your client version.
Oracle version 8.0.0.0 (8.0)
DBD::Oracle no longer supports Oracle client versions before 9.2
Try a version before 1.25 for 9 and 1.18 for 8! at Makefile.PL line 271.
The instant client version: 11.1.0
The DBD::Oracle version is 1.44
If you have installed successfully with the Oracle instant client, then could you please let me know what am I missing?
Is it possible to install DBD::Oracle without using the Oracle instant client?
Install if missing ExtUtils-MakeMaker module (sudo yum install perl-ExtUtils-MakeMaker)
Install Perl DBI module ($ yum install perl-DBI)
Manually install below three RPMs for Oracle instant client (from Instant Client Downloads for Linux x86-64. The example is for v11.2.0.3.0-1: adapt the commands below to the actual version.)
oracle-instantclient11.2-basic-11.2.0.3.0-1
oracle-instantclient11.2-devel-11.2.0.3.0-1
oracle-instantclient11.2-sqlplus-11.2.0.3.0-1
I am using 64 bit Linux box, so select your RPM filenames accordingly. Something like sudo yum -y install oracle-instantclient*rpm should do)
set below variables:
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
MacOS users will need:
DYLD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/
Also add ORACLE_HOME to your PATH variable.
download DBD::Oracle from CPAN
untar the module and run below commands in given sequence:
perl Makefile.PL
make
sudo make install
In case you get complaints about missing gcc you can (temporarily) install it and then remove it.
DONE !!!
Issues I had faced were due to the wrong LD_LIBRARY_PATH. I had set it to /usr/lib/oracle/11.2/client64 whereas the correct value is /usr/lib/oracle/11.2/client64/lib.
Certainly, this was a great learning for a newbie like me.
you can also read my article How to install DBD::Oracle which contains all the steps required to install DBD::Oracle CPAN module, which is not a straightforward installation. The purpose is to reduce headache and turn it into a repeatable process.
Here's what I did on CentOS 7.2 using yum packages and CPAN. This assumes you're using Oracle version 12.1 but I would imagine most versions will work this way.
Install Oracle Instant Client
yum install oracle-instantclient12.1-basic-12.1.0.2.0-1 oracle-instantclient12.1-devel-12.1.0.2.0-1 oracle-instantclient12.1-sqlplus-12.1.0.2.0-1
Copy demo make files
The install expects the *.mk file to be in /usr/share/oracle/12.1/client64 but the yum package install puts them in /usr/share/oracle/12.1/client64/demo.
sudo cp /usr/share/oracle/12.1/client64/demo/* /usr/share/oracle/12.1/client64
Modify .bashrc
Add the following lines to your ~/.bashrc
export ORACLE_HOME=/usr/lib/oracle/12.1/client64
export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib
export PATH=$ORACLE_HOME:$PATH
Now source the file
source ~/.bashrc
Update CPAN and DBI
Update CPAN and DBI to the latest
cpan> install CPAN
cpan> reload cpan
cpan> install DBI
Install DBD::Oracle
cpan> install DBD::Oracle
A little addition to slayedbylucifer answer. I had the same problem like mentioned in the question. I've done all the steps described by slayedbylucifer. But still I got the problem like mentioned here:
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: skipping incompatible /opt/oracle/app/oracle/product/11.2.0/client_1/lib//libclntsh.so when searching for -lclntsh
/usr/lib64/gcc/x86_64-suse-linux/4.3/../../../../x86_64-suse-linux/bin/ld: cannot find -lclntsh
So I created the following symbolic link:
ln -s /opt/oracle/app/oracle/product/<YOUR_ORACLE_VERSION>/client_1/lib/libclntsh.so $ORACLE_HOME/libclntsh.so*
After that step the error from above (cannot find -lclntsh) was fixed. The execution of the make command was without any errors.
The only problem I still have is that I don't understand why this symbolic link is necessary.