pecl - gearman - Unable to load dynamic library? - php

I'm setting up the default instance for a new Amazon Elastic Beanstalk cluster however I'm having issues installing the gearman php client via pecl.
I ran pecl install mongo without any issues, but after I run pecl install gearman it gives the following error:
[root#ip ~]# php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/gearman.so' - libgearman.so.8: cannot open shared object file: No such file or directory in Unknown on line 0
I do have gearmand installed, just the php client is giving me trouble. The php module gearman.so is in the "/usr/lib64/php/modules/" folder too.
Anyone have any idea why this might be happening?

Unfortunately gearman is a bit more complicated to install. You will need to download and compile the gearman server even if you don't intend to use your current server for gearman. It provides the library that you are missing.
If you look at the error message its missing libgearman.so.8 not gearman.so

Related

Not able to load php_grpc.dll for php 5.6 in xampp for windows

I am trying to use google cloud php sdk to fetch from google bigtable and found that it requires grpc to be enabled.
So i tried installing grpc on my xampp by downloading dll file from https://pecl.php.net/package/gRPC
I am running PHP version 5.6 on using xampp on my windows machine
I also updated my php.ini file by adding below
extension=php_grpc.dll
I restarted apache and printing phpinfo but i am not able to find grpc module loaded.
I also checked the list of extensions loaded by running php -m command and i get below error.
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_grpc.dll' - The specified module could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_grpc.dll' - The specified module could not be found.
in Unknown on line 0
Can anyone provide me a solution?
I was facing the same issue when installing the Google Ads PHP library on WAMP Server. I solved it downloading a different gRPC version
https://windows.php.net/downloads/pecl/releases/grpc/1.17.0/
Extacted the file and copied on the extensions directory of WAMP and on the php.ini just add the next line
extension=grpc
Restart apache and php. Hope it helps

PHP Warning: PHP Startup: Unable to load dynamic library 'cassandra.so' (tried: /usr/lib/php/20170718/cassandra

I'm setting up square api, integrated it in client side and now working on server side but for that i need to manage dependencies with composer, while installing composer I got above error.
I was installing composer, when i run composer install, composer was installed but I got the PHP warning in addition i.e
PHP Warning: PHP Startup: Unable to load dynamic library
'cassandra.so' (tried: /usr/lib/php/20170718/cassandra.so
(/usr/lib/php/20170718/cassandra.so: cannot open shared object file:
No such file or directory), /usr/lib/php/20170718/cassandra.so.so
(/usr/lib/php/20170718/cassandra.so.so: cannot open shared object
file: No such file or directory)) in Unknown on line 0
I googled and tried all the solutions that have already been done, but none worked to mine. I have tried:
To find out cassandra at php.ini in /etc/php/7.2/cli but i did't find it.
To install Cassandra by using command sudo apt-get install php-cassandra in /usr/lib/php/20170718, but it still shows the same error.
Update and upgrade the Ubuntu, to make sure that there are no internal errors, if there was any?
I expect to install cassandra and load it dynamically.
The DataStax PHP driver extension is a wrapper around the C/C++ driver and requires installation of all of its dependencies:
C/C++ driver
libuv 1.x
OpenSSL v1.0.x or v1.1.x (depends on how your PHP is built)
The GNU Multiple Precision Arithmetic Library
Since you are using the PHP driver with PHP v7.2 you will need to build the extension as their are no pre-built binaries for this version of PHP:
git clone https://github.com/datastax/php-driver.git
cd php-driver/ext
phpize
cd ..
mkdir build
cd build
../ext/configure
make
sudo make install
Note: The development packages of all of dependencies will be required in order to properly build the extension.
Once the driver is installed you will need to edit your php.ini file to enable the extension which can be located by executing php -r "echo php_ini_loaded_file();":
; DataStax PHP Driver for Apache Cassandra
extension=cassandra.so
To ensure the the driver is being properly loaded via CLI you can execute the following:
php -m | grep cassandra
or
php -i | grep -A 10 "^cassandra$"
php -m will print out all the extension/modules that PHP was able to load whereas php -i will display more verbose information about your PHP installation configuration.

Installing PHP SDK Couchbase error

I'm trying to install the PHP SDK for my Couchbase cluster and everything during installation finishes without a hitch, but when I run php -i in the terminal I get the following error:
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/lib/php5/20121212/couchbase.so' -
/usr/lib/php5/20121212/couchbase.so: undefined symbol:
php_json_decode_ex in Unknown on line 0
I don't understand why the couchbase extension won't load.
My setup is:
Ubuntu Server 14.04
Couchbase Server Enterprise 4.5.1
I followed this guide for setting up PHP SDK:
Link to PHP SDK installation guide
Enable extension=json.so in your php.ini if it is not enabled. If it is, enable the couchbase extension after the json extension.
As said in the couchbase php sdk documentation
The Couchbase SDK depends on the JSON PHP extension, so make sure that load order is correct. For example, if your distribution has just a single php.ini file, just insert the line after extension=json.so. If your distribution uses a conf.d-style, name the file with the Couchbase SDK ini so that it will be alphabetically ordered after the JSON extension.

Zend Server 8 PDO could not find driver via CLI

I installed Zend Server 8, and I need to run scripts that use MySQL via the command line.
I get this error when I run one of my CLI scripts:
PDOException
could not find driver
But everything works via http, problem only occurs in CLI. I know there is a different php.ini for the CLI. However, when i reference the php.ini that the server uses for http like this:
php -c/usr/local/zend/etc/php.ini my-script
I get this:
Warning: PHP Startup: Unable to load dynamic library
/usr/local/zend/lib/php_extensions/pdo.so' -
/usr/local/zend/lib/php_extensions/pdo.so:
cannot open shared object file:
No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library /usr/local/zend/lib/php_extensions/readline.so' - /usr/local/zend/lib/php_extensions/readline.so:
cannot open shared object file:
No such file or directory in Unknown on line 0
Fatal error: Class 'PDO' not found in /var/www/html/vendor/doctrine/dbal/lib/Doctrine/DBAL/DriverManager.php on line 155
I have no idea how to troubleshoot this. I use Ubuntu 14.04 if that makes a difference.
It might also be useful to say that I installed LAMP first like this:
sudo apt-get install lamp-server^ and then I installed Zend Server
Any suggestions?
Thank you.
I ended up just changing the php alias to the php that was installed by Zend Server like this:
alias php=/usr/local/zend/bin/php
This seems to work, but still looking for a better/proper solution.

PHP 5.5 not finding MySQLi constructor

I have mySQL and PHP 5.5 installed on an AWS EC2 instance. However, when I try
$db = new mysqli($args)
PHP kicks me to the autoloader, as if it can not find the constructor for the mysqli object. I have uncommented extension=mysql.so in the php.ini file, but that does not seem to have accomplished anything. At startup, I get
PHP Startup: Unable to load dynamic library '/usr/lib64/php/5.5/modules/msql.so' - /usr/lib64/php/5.5/modules/msql.so: cannot open shared object file: No such file or directory in Unknown on line 0
I thought that mysqli/native driver came prepackaged with PHP5.5, but maybe I was wrong about that. Can someone give me a hint as to how PHP5.5 plays with mysqli?
It doesn't come prepackaged in the case of Amazon Linux. It's an addon module (Assuming you are using Amazon Linux). You can run:
sudo yum install php55-mysqlnd
Maybe misspelled? PHP is trying to load msqli.so, not mysqli.so. Check that you write "extension=mysqli.so", not "extension=msqli.so"

Categories