mongodb - Install with pecl to local dir on shared hosting -


i'd install php extension on bluehost shared site; mongodb driver. since pecl unable write primary server directory has installed extensions, i'd install mongo.so file directory specify under home. closest article found on web was:

http://www.site5.com/blog/programming/php/how-to-setup-your-own-php-pear-environment/20090624/

however, after following steps when use "pecl install mongo" command, still keeps trying install bluehost's central directory on server.

according web host's technical support team, utilising pecl installer attempts install extension server-wide rather under account only. web host doesn't allow server-wide installations in shared environment security reasons , because want keep fleet universally same across board. suspect host same.

however, did suggest download, configure , install pecl package (pecl_http) in account (rather server-wide) via following manual process:

$ cd ~/  $ wget http://pecl.php.net/get/pecl_http $ tar -zxvf pecl_http.tar.gz $ cd pecl_http $ phpize $ ./configure --prefix=~/bin $ make $ make test $ make install 

a successful install have created extname.so , put php extensions directory. you'll need edit php.ini (in case, copy of standard php.ini file placed in same folder script using extension) , add extension=extname.so line (in case, extension=http.so) before can use extension. http://www.php.net/manual/en/install.pecl.phpize.php

note tilde character (~) in above code refers home directory of current user (e.g. /home/username on host's server).

issues may run into

  1. when using tar command, "cannot open: not directory" error appeared pecl_http had been downloaded without file extension. corrected:

    mv pecl_http pecl_http.tar.gz 
  2. when using make install command, "cp: cannot create regular file...: permission denied" errror appeared. resolved issue changing ext_dir pecl...

    pecl config-set ext_dir /home/username/bin/extensions  

    ...and re-running make install. had copy http.so extension /home/username/bin/extensions , reference location in php.ini file:

    extension_dir = "/home/username/bin/extensions" 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -