i have installed couchbase on ubuntu:
$ php -i | grep couchbase
Additional .ini files parsed => /etc/php5/cli/conf.d/couchbase.ini,
couchbase
couchbase support => enabled
libcouchbase version => 2.0.5
couchbase.compression_factor => 1.3 => 1.3
couchbase.compression_threshold => 2000 => 2000
couchbase.compressor => none => none
couchbase.config_cache => no value => no value
couchbase.durability_default_poll_interval => 100000 => 100000
couchbase.durability_default_timeout => 40000000 => 40000000
couchbase.instance.persistent => On => On
couchbase.restflush => On => On
couchbase.serializer => php => php
couchbase.view_timeout => 75 => 75
i have also done this:
$ locate libevent.so
/opt/couchbase/lib/libevent.so
$ export DYLD_LIBRARY_PATH=/opt/couchbase/lib
$ echo $DYLD_LIBRARY_PATH
/opt/couchbase/lib
so now i try and run the following script:
#!/usr/bin/php
<?php
$cb = new Couchbase("127.0.0.1:8091", "", "", "default");
$cb->set("a", 101);
var_dump($cb->get("a"));
?>
but i get the following errors:
PHP Fatal error: Uncaught exception 'CouchbaseLibcouchbaseException' with message 'Failed to create libcouchbase instance' in /tmp/test.php:3
how should i fix this problem?
i took eddie's advice and reinstalled using apt. now everything works fine:
sudo wget -O/etc/apt/sources.list.d/couchbase.list http://packages.couchbase.com/ubuntu/couchbase-ubuntu1204.list
wget -O- http://packages.couchbase.com/ubuntu/couchbase.key | sudo apt-key add -
sudo apt-get update
sudo apt-get install libcouchbase{2,-dev,-dbg}
Related
I am running a few sites that has different php versions running (7.0 and 7.4)
For one of the sites, when I try to run soap code, I get:
Uncaught Error: Class 'SoapClient' not found
When I run
php -i | grep -i soap
i get the following output:
/etc/php/7.4/cli/conf.d/20-soap.ini,
soap
Soap Client => enabled
Soap Server => enabled
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400
I need to install the soap for php 7.0 and I am not that familiar with linux so I would love to get some step by step instructions.
Thanks!
I have installed Microsoft ODBC Driver 17 for SQL Server as a PECL using: pecl install pdo_sqlsrv sqlsrv (Ubuntu 16.04.6, php 7.3, apache).
I've also added:
extension=sqlsrv.so
extension=pdo_sqlsrv.so
to /etc/php/7.3/apache2/conf.d/xx-sqlsrv.ini and it is properly listed on active modules while checking phpinfo(); rendered by Apache.
When I try to use the SQLSrv lib, then I'm getting an error:
Array ( [0] => Array ( [0] => 01000 [SQLSTATE] => 01000 [1] => 0 [code] => 0 [2] => [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found [message] => [unixODBC][Driver Manager]Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found ) )
However, the file /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1 exists and is accessible by all:
ls -al /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
-rwxr-xr-x 1 root root 2046672 Feb 12 21:08 /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
Accessing by sqlcmd also returns an error:
sqlcmd -S <server_ip> -U <user_name> -P <pass>
Sqlcmd: Error: Microsoft ODBC Driver 17 for SQL Server : Can't open lib '/opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1' : file not found.
Following some other issues, I've checked the dependencies and they seem ok:
ldd /opt/microsoft/msodbcsql17/lib64/libmsodbcsql-17.3.so.1.1
linux-vdso.so.1 => (0x00007ffd0c14b000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4fd9349000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f4fd9141000)
libodbcinst.so.2 => /usr/lib/x86_64-linux-gnu/libodbcinst.so.2 (0x00007f4fd8f26000)
libcrypto.so.1.0.2 => not found
libkrb5.so.3 => /usr/lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f4fd8c54000)
libgssapi_krb5.so.2 => /usr/lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f4fd8a0a000)
libssl.so.1.0.2 => not found
libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f4fd8805000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f4fd8422000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f4fd8119000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f4fd7f01000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f4fd7ce4000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4fd791a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f4fd9954000)
libk5crypto.so.3 => /usr/lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f4fd76eb000)
libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f4fd74e7000)
libkrb5support.so.0 => /usr/lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f4fd72dc000)
libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f4fd70d8000)
libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f4fd6ebd000)
It turned out there was a wrong package source in /etc/apt/sources.list.d/mssql-release.list. Steps to resolve the problem:
rm /etc/apt/sources.list.d/mssql-release.list
apt remove msodbcsql17 mssql-tools
Add the correct package source basing on the official documentation
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
#Ubuntu 16.04
curl https://packages.microsoft.com/config/ubuntu/16.04/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt update
ACCEPT_EULA=Y apt-get install msodbcsql17
I am using Centos 6 64 bit OS. Recently i have installed OCI8 extension with php. After making all configuration i tried to execute the function oci_connect to connect with a Oracle Database remotely.
Unfortunately i got this error:
Fatal error: Call to undefined function oci_connect() in /var/www/html/index.php on line 5
I have installed oci8 like this:
OCI8
Download the OCI8 source using pear
$ pear download pecl/oci8
$ tar -xvf oci8-1.4.9.tgz
$ cd oci8-1.4.9
Build and install the extension.
$ phpize
$ ./configure --with-oci8=shared,instantclient,/usr/lib/oracle/11.2/client64/lib
$ make
$ sudo make install
To enable the extension, add a file named oci8.ini in /etc/php.d with
this content:
extension=oci8.so
Validate that it was successfully installed.
$ php -i | grep oci8
You should see something like this:
/etc/php.d/oci8.ini,
oci8
oci8.connection_class => no value => no value
oci8.default_prefetch => 100 => 100
oci8.events => Off => Off
oci8.max_persistent => -1 => -1
oci8.old_oci_close_semantics => Off => Off
oci8.persistent_timeout => -1 => -1
oci8.ping_interval => 60 => 60
oci8.privileged_connect => Off => Off
oci8.statement_cache_size => 20 => 20
Ref: http://shiki.me/blog/installing-pdo_oci-and-oci8-php-extensions-on-centos-6-4-64bit/
I would like to mention that when the installation started is message was display something like: instantclient, /../../ to PUT THE PATH. I didn't give anything, just pressed enter. Is it the issue that i can't connect to Oracle ?
Need your help badly.
Thanks
I have managed to solve problem. Actually the problem was the the environment library was not loaded. so i have loaded the environment of oracle manually via PHP .
Here is my code:
> if (!$conn):
> /// INCLUDING ORACLE_HOME MANUALLY
> putenv("ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1/");
> // INCLUDING LD_LIBRARY_PATH MANUALLY
> putenv("LD_LIBRARY_PATH=/u01/app/oracle/product/11.2.0/dbhome_1/lib:/lib:/usr/lib:/lib:/usr/lib:/usr/local/lib");
>
> $conn = "(DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = xxx.xxx.xxx.xxx)(PORT = 1521)))
> (CONNECT_DATA = (SERVICE_NAME = data)))";
> $conn = oci_pconnect("username", "password", $conn);
> endif;
> if($conn):
> return $conn;
> endif;
> if(!$conn):
> redirect('login');
> endif;
> }
Hope that it will help everyone
Thanks,
step-01 For correct installation oci8 refer this link
http://www.techinfobest.com/install-oci8/
After successfully installation
step-02 Check php configuration where separate section for OCI8 listed are not
<?php echo phpinfo(); ?>
if not listed.
step-03 check your httpd error log by terminal
cat /var/log/httpd/error_log
find any php error occured while after httpd service starting like
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/oci8.so' - libclntsh.so.12.1: cannot enable executable stack as shared object requires: Permission denied in Unknown on line 0
then it is the problem in your selinux permission. find below link to proper permission.
step-03 http://www.cdatazone.org/index.php?/archives/37-PHP,-Oracle-and-SELinux.html
I have followed these steps and got success to oracle installation
For Centos 7, I do not know if works in Centos 6.
$ sudo vim /etc/ld.so.conf.d/oracle-instantclient.conf
// Add path to oracle client lib, the XX is the version, ex: /usr/lib/oracle/XX/client64/lib
$ sudo ldconfig
$ sudo service php-fpm restart
Done!
I have installed pecl_http on a PLESK server (which seems to be successful) but for some reason, the http extension will not load into PHP.
var_dump(extension_loaded("http"));
gives me bool(false).
pecl info pecl_http gives me a lot of info and if I run php -me http is also listed.
php -i | grep "http_request" gives me:
http_request => N/A => 0 => 0
http_request_datashare => GLOBAL => 1 => 0
http_request_pool => N/A => 0 => 0
and if I run pecl run-tests -p pecl_http I get a lot of FAILs
and I am also getting
Fatal error: Call to undefined function http_get()
http.so is located inside /usr/lib/php/modules/ which is also defined as the extension dir in php.ini - all other extensions loads fine.
What have I missed?
What happens if change
enable_dl = Off
to
enable_dl = On
in php.ini and run
php -r "dl('http.so');"
?
I've installed libmemcached and memcached pecl extension for php and for some reason it's not installing correctly? i've got memcached.so in /usr/lib64/php/ with the right permissions and libmemcache.so in /usr/local/lib/
Everything seemed to build correctly without error, and I restarted apache?
i also have the daemon installed.
I somehow easily got the Memcache class easily installed for php before, but I realized what i wanted was the Memcached (note the d) class. let me know if more info is needed!
EDIT: I previously had memcache (without the d) working in php so I know i was manipulating the correct php.ini!
EDIT 2: there WAS indeed an apache error!
Unable to load dynamic library '/usr/lib64/php/modules/memcached.so' - /usr/lib64/php/modules/memcached.so: undefined symbol: php_json_encode in Unknown on line 0
I've solved it in centos5 using the yum installer instead of the pecl install memcached
THIS way --> yum install php-pecl-memcached
then, service httpd restart and it shows up in phpinfo()
I have the similar error few days ago. Instaling of new version(2.0) of memcached helped me.
yum -y install gcc-c++
wget http://launchpad.net/libmemcached/1.0/0.50/+download/libmemcached-0.50.tar.gz
tar xzf libmemcached-0.50.tar.gz
cd libmemcached-0.50
./configure
make
make install
wget http://pecl.php.net/get/memcached-2.0.0b2.tgz
pecl install memcached-2.0.0b2.tgz
echo 'extension=memcached.so' > /etc/php.d/memcached.ini
service php-fpm restart
cd ..
rm -r libmemcached-0.50*
rm -r memcached-
I don't know if it's the same problem but after struggling with this for hours I manage to have PHP properly installed with Memcached on CentOS using the command bellow:
yum --enablerepo=remi-php73 install php-memcached
Test installation:
php -i | grep -i memcache
Should show something like:
/etc/php.d/50-memcached.ini
memcached
memcached support => enabled
libmemcached version => 1.0.18
memcached.compression_factor => 1.3 => 1.3
memcached.compression_threshold => 2000 => 2000
memcached.compression_type => fastlz => fastlz
memcached.default_binary_protocol => Off => Off
memcached.default_connect_timeout => 0 => 0
memcached.default_consistent_hash => Off => Off
memcached.serializer => igbinary => igbinary
memcached.sess_binary_protocol => On => On
memcached.sess_connect_timeout => 0 => 0
memcached.sess_consistent_hash => On => On
memcached.sess_consistent_hash_type => ketama => ketama
memcached.sess_lock_expire => 0 => 0
memcached.sess_lock_max_wait => not set => not set
memcached.sess_lock_retries => 5 => 5
memcached.sess_lock_wait => not set => not set
memcached.sess_lock_wait_max => 150 => 150
memcached.sess_lock_wait_min => 150 => 150
memcached.sess_locking => On => On
memcached.sess_number_of_replicas => 0 => 0
memcached.sess_persistent => Off => Off
memcached.sess_prefix => memc.sess.key. => memc.sess.key.
memcached.sess_randomize_replica_read => Off => Off
memcached.sess_remove_failed_servers => Off => Off
memcached.sess_sasl_password => no value => no value
memcached.sess_sasl_username => no value => no value
memcached.sess_server_failure_limit => 0 => 0
memcached.store_retry_count => 2 => 2
Registered save handlers => files user memcached
add
extension=memcache.so
in php.ini then restart apache