Add rdkafka extension to PHP in windows environment

Because the work requires kafka as a message middleware, you need to add the rdkafka extension to PHP when testing in the local development environment, and use PHP as the producer or cosumer. Record the installation process of rdkafka here.

Extension download address: http://pecl.php.net/package/rdkafka

Select the corresponding package according to your own PHP version, and use the phpinfo() function to easily check your own PHP version:

Mine is the 7.1.5 vc14 x64 nts version of php, so select the corresponding extension package to download:

After the expansion package of the windows version is downloaded, it is a compressed file. After decompression, a bunch of files are obtained.

Put rdkafka.dll in the ext folder in the php directory, librdkafka.dll in the php directory, then modify php.ini and add:

extension=php_rdkafka.dll

Then restart the server, and then check through phpinfo, you can see that the rdkafka extension has been successfully installed

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324973427&siteId=291194637