Git Product home page Git Product logo

Comments (16)

the100rabh avatar the100rabh commented on July 23, 2024 5

Running following commands to load the shared library folder in env variables solved this for me

 LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBRARY_PATH

from phpkafka.

abdollahpour avatar abdollahpour commented on July 23, 2024 2

I fixed it finally on CentOS 7!! For both CLI and FPM

echo '/usr/local/lib' > /etc/ld.so.conf.d/kafka.conf
echo 'export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/lib64/php/modules:/usr/local/lib"' >> /etc/profile
ldconfig

from phpkafka.

siyuanmami avatar siyuanmami commented on July 23, 2024 1

@EVODelavega
Hi EVODelavega,
I installed phpkafka in CentOS 6.5 by these commands:
ldconfig
/usr/bin/phpize
./configure --enable-kafka --with-php-config=/usr/bin/php-config
make
make install

then I can see kafka.so under /usr/lib64/php/modules.

but when I executed 'service php-fpm restart', it told me:
Starting php-fpm: [16-Oct-2015 17:07:23] NOTICE: PHP message: PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/kafka.so' - librdkafka.so.1: cannot open shared object file: No such file or directory in Unknown on line 0

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?
Thanks!

from phpkafka.

yunkaiyueming avatar yunkaiyueming commented on July 23, 2024

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?

from phpkafka.

yunkaiyueming avatar yunkaiyueming commented on July 23, 2024

@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) { }
but '$kafka->produce' and '$kafka->consume' give nothing ,untile nginx server response 502,
what's wrong?

from phpkafka.

the100rabh avatar the100rabh commented on July 23, 2024

I too tried using consume function thats the one that gives the issue.
produce works fine.

from phpkafka.

EVODelavega avatar EVODelavega commented on July 23, 2024

@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 (consume-with-meta branch), which adds a couple of methods like getPartitionsForTopic that enable you to set the partition correctly before consuming

from phpkafka.

EVODelavega avatar EVODelavega commented on July 23, 2024

salebab's repo has been abandoned, I've forked it and I'm developing it
further. Currently, the consume-with-meta branch is the one that is most
up-to-date. If you have any issues/suggestions, you can create an issue on
my fork, as my changes will probably not get merged (there's a PR ready and
waiting, but the owner, salebab, hasn't merged them, instead, he's updated
the README file, linking to my fork).

If you want, you can use my fork for testing, mind you, it's far from being
stable

On Tue, Apr 7, 2015 at 11:48 PM, eparisca [email protected] wrote:

@EVODelavega https://github.com/EVODelavega Do you have an estimate on
when you will merge that fork's features? Thank you very much!


Reply to this email directly or view it on GitHub
#6 (comment).

from phpkafka.

EVODelavega avatar EVODelavega commented on July 23, 2024

@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

from phpkafka.

siyuanmami avatar siyuanmami commented on July 23, 2024

@EVODelavega
Thanks for your help.
I have confirmed with edenhill about it, I should have installed librdkafka library correctly.
Not sure if it is because I am using php-fpm.
I used to install this extension on ubuntu worked with apache, it is fine.

Thanks!

from phpkafka.

EVODelavega avatar EVODelavega commented on July 23, 2024

@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?

from phpkafka.

edenhill avatar edenhill commented on July 23, 2024

@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?

from phpkafka.

siyuanmami avatar siyuanmami commented on July 23, 2024

@EVODelavega
Thanks you for you help!
I have installed the php extension successfully after I updated /etc/ld.so.conf to include /usr/local/lib !

from phpkafka.

EVODelavega avatar EVODelavega commented on July 23, 2024

@edenhill Done, added some instructions that should be rather dummy-proof to the README on current master

from phpkafka.

kaustavha avatar kaustavha commented on July 23, 2024

Thanks @the100rabh your solution helped me get kafkacat working.

from phpkafka.

amitlokulwar avatar amitlokulwar commented on July 23, 2024

@abdollahpour
I had tried above command that you told but that is also not working.
Still I am getting same error.
Could you please tell me what else step you taken to resolve that issue.
Thank You!!!
kafka

from phpkafka.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.