-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to load dynamic library '/root/phpkafka/modules/kafka.so' - librdkafka.so.1: cannot open shared object file: No such file or directory in Unknown on line 0 #6
Comments
when i use phpkafka function in my php file: " Fatal error: Class 'Kafka' not found in /usr/local/www/kafka-php/test_kafka.php on line 5 " I know i havn't install phpkafka into php_extension rightly, how can i solve it? |
Running following commands to load the shared library folder in env variables solved this for me
|
@the100rabh : thanks for your answer, i have solved this problem, i have compiled the 'phpkafka' into php_extension, when i use the next code into my php file: test_phpkafka.php produce("topic_name", "message content"); $kafka->consume("topic_name", 1172556); ?>new 'Kafka' is ok, var_dump($kafka) is : object(Kafka)#1 (0) { } |
I too tried using consume function thats the one that gives the issue. |
@yunkaiyueming The problem is that this extension, ATM still requires you to specify what partition to consume from. I'm working on a fix for that, though. for now, you can use my fork ( |
salebab's repo has been abandoned, I've forked it and I'm developing it If you want, you can use my fork for testing, mind you, it's far from being On Tue, Apr 7, 2015 at 11:48 PM, eparisca [email protected] wrote:
|
* commit 'b87f564b5490a469449bf7c83d62eee9f7f9e66c': update readme
@EVODelavega then I can see kafka.so under /usr/lib64/php/modules. but when I executed 'service php-fpm restart', it told me: I have tried export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib as well, but it still not work. Could you give me some suggestion about it? |
@siyuanmami Not sure, I know there were some issues with building librdkafka on CentOS some time ago, so maybe you want to check the issues on edenhill's librdkafka repo. So far, I've only tested the extension on debian, Slackware, mint and ubuntu. I haven't seen the issue you're reporting on any of those systems, though |
@EVODelavega Thanks! |
@siyuanmami php-fpm shouldn't be an issue. AFAIK, it handles the MINIT, RINIT, RSHUTDOWN and MSHUTDOWN cycles in exactly the same way, and as it stands, there's very little in the module init and shutdown functions that could trip PHP up. But having said that: what version are you currently using? What repo, what branch? |
@EVODelavega This seems to come up quite often, librdkafka.so.1 not being in the library search for the PHP invociation and people dont really know how to fix it, so may I suggest you add some instructions in README? |
@EVODelavega |
@edenhill Done, added some instructions that should be rather dummy-proof to the README on current master |
Thanks @the100rabh your solution helped me get kafkacat working. |
I fixed it finally on CentOS 7!! For both CLI and FPM
|
@abdollahpour |
when i 'make' phpkafka, it occured the followed issue:
[root@OA-test phpkafka]# make test
Build complete.
Don't forget to run 'make test'.
PHP Warning: PHP Startup: Unable to load dynamic library '/root/phpkafka/modules/kafka.so' - librdkafka.so.1: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/root/phpkafka/modules/kafka.so' - librdkafka.so.1: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/root/phpkafka/modules/kafka.so' - librdkafka.so.1: cannot open shared object file: No such file or directory in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/root/phpkafka/modules/kafka.so' - librdkafka.so.1: cannot open shared object file: No such file or directory in Unknown on line 0
how can i solve it??? please help me
The text was updated successfully, but these errors were encountered: