Installing librdkafka on Windows for PHP XAMPP - php

Please help me to install librdkafka on windows xampp for php development.
PHP : 7.1.12, x86, Thread Safe, MSVC14
I downloaded compatible package from https://pecl.php.net/package/rdkafka/3.0.5/windows
Copied php_rdkafka.dll to ext folder of my php xampp and librdkafka.dll to System32 folder (also to ext folder).
But the extension is not working. I am getting following error:
PHP Warning: PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_rdkafka.dll' - The specified module could not be
found. in Unknown on line 0
I suspect that librdkafka is not properly installed.

I managed to make it work by doing below steps.
Copy librdkafka.dll to C:\Windows\SysWOW64 if x86 otherwise copy to C:\Windows\System32. Don't copy to both folders.
Then run regsvr32 librdkafka.dll in command prompt.
Then copy php_rdkafka.dll to ext folder of your php.
Then add extension=php_rdkafka.dll to your php.ini file
Restart PHP, DONE!!!

The accepted answer did not work for me, instead I installed the dependency as following:
Download the library from https://pecl.php.net/package/rdkafka
Extract the file librdkafka.dll to the the root PHP directory (same level as php.exe for example C:\xampp\php).
Extract the file php_rdkfaka.dll to the ext folder: C:\xampp\php\ext
Add the line extension=php_rdkafka.dll to the php.ini.
Restart the server.
Note: within the library you will download, you will find a README.md with a link to the official documentation.

Related

How to fix: Unable to load dynamic library 'C:\Program Files\php\ext\php_imagick.dll' - The specified module could not be found in Unknown on line 0?

UPDATE: I realized I need to install ImageMagick on the same server that PHP is running on, in addition to using the php_imagick.dll library. I've tried a series of different combinations of versions of the ImageMagick installer and the php_imagick.dll library to no avail. How do I know which version number of each I should use?
I'm running PHP 5.6.40 (non-thread-safe) on a Windows Server 2019 machine.
My PHP website seems to be working for the most part except when I run php -m in the command line I get the warning that the php_imagick.dll module could not be found.
When I run a test PHP file that calls phpinfo(), the ImageMagick - php_imagick.dll extension is not listed anywhere.
In my php.ini file I have the full path for my extensions directory:
I also have the extension for ImageMagick (php_imagick.dll) listed in the php.ini:
ImageMagick (php_imagick.dll) is definitely in the extensions folder listed above:
Why am I receiving the warning it was unable to load that library when I run php -m from the command line?
Probably, your server uses another *.ini file to load or some permissions are incorrect.
Try to search other configuration files such as php.ini-development and uncomment the line containing your extension in each file.
Make sure your php_imagick.dll library is visible by your PHP-server.
Restart your PHP-server after any changes in configuration files.
refer to this doc, it helps me and solves. As, I am using Php 7.4
https://www.geeksforgeeks.org/how-to-install-imagick-for-php-in-windows/

php_pgsql package extension is not loaded automatically from /etc/php.d/ directory

I have installed php_pgsql package using the command
yum install rh-php56-php-pgsql.x86_64
I am developing my project with
PHP 5.6.27
PostgreSQL 9.6.1
RedHat 7 OS
instalation was succesful..
Installed: rh-php56-php-pgsql.x86_64 0:5.6.5-9.el7
Dependency Installed: audit-libs-python.x86_64 0:2.6.5-3.el7
checkpolicy.x86_64 0:2.5-4.el7 libcgroup.x86_64 0:0.41-11.el7
libsemanage-python.x86_64 0:2.5-4.el7 policycoreutils-python.x86_64
0:2.5-8.el7 python-IPy.noarch 0:0.75-6.el7
rh-php56-php-common.x86_64 0:5.6.5-9.el7 rh-php56-php-pdo.x86_64
0:5.6.5-9.el7 rh-php56-php-pecl-jsonc.x86_64 0:1.3.6-3.el7
rh-php56-runtime.x86_64 0:2.0-6.el7 setools-libs.x86_64
0:3.3.8-1.1.el7
Complete!
I could find the pgsql.ini file in /etc/php.d/ directory.
still the php.info page is not showing the pgsql details.
please check my error_log file
PHP Startup: Unable to load dynamic library '/opt/cpanel/ea-php56/root/usr/lib64/php/modules/pgsql.so' - /opt/cpanel/ea-php56/root/usr/lib64/php/modules/pgsql.so: cannot open shared object file: No such file or directory in Unknown on line 0
So my instalation was not added the pgsql.so file in the right place. I dont know how to sove this issue. please help, thanks in advance.
finally i solved the issue..
The package instalation was actually done to the DIR PATH
/usr/lib64/php/modules/pgsql.so
I ensured it with the command
rpm -ql php-pgsql
from the PHP config file i found the exact PHP Module path.
by moving the pgsql.so file into the location made the module enabled for PHP.

Unable to load dynamic library php_ldap.dll

I've looked at many of the previous questions, but I'm still unable to get this issue fixed. I've installed PHP Version 5.4.9 and Apache 2.4.12 in windows - 64Bit. When I start the service I get the following error :
PHP Warning: PHP Startup: Unable to load dynamic library 'D:\app\php\ext\php_ldap.dll' - The specified module could not be found in Unknown on line 0.
The path where PHP is : D:\app\php
My extension path in php.ini is : extension_dir = D:\app\php\ext
Path where libeay32.dll and ssleay32.dll is : D:\app\php
I referred to the Questions posted in the link below :
Link 1
Link 2
Link 3
yet nothing seems to work. Appreciate any help.
after enabling extension =php_ldap.dll in php.ini
you must add following dll to system32 in windows
copy libsasl.dll into system32 folder
steps:
php.ini
enable
;extension =php_ldap.dll --> extension =php_ldap.dll
copy libsasl.dll from php folder and paste it in system32
windows-->system32--> paste libsasl.dll
Incase it does not work and also add libeay32.dll and ssleay32.dll.
Try copying libeay32.dll,ssleay32.dll and libeay32.dll in sysWow64 and Restart the machine. It should work.
with Win10, Apache 2.4.41x64 and php 7.3.8x64 the following worked for me:
overwrite these dlls in Apache/bin folder with the files from php folder
libssl-1_1-x64.dll
libcrypto-1_1-x64.dll
also added libsasl.dll
Do not need to change any system folder content.
Of course the the right php.ini settings are crucial (enable extension, set extension path).
Then restart Apache.
For Windows 10
copy a file from 'xampp\php\libsasl.dll' and paste it into 'xampp\apache\bin'
After this restart Apache server once.

PHP Startup:Unable to load dynamic library 'php_intl.dll'- The specified module could not be found

I have downloaded wamp server from http://www.wampserver.com/en/ in my Windows 8 laptop which is a 32 bit system.
On clicking on the pink wamp server icon on the desktop the i get the following error:
PHP Startup:Unable to load dynamic library
'c:/wamp/bin/php/php5.5.12/ext/php_intl.dll'- The specified module
could not be found.
what should I do?
I have already tried uninstalling and re installing the program several times, but the same problem persists.
copy the icu*.dll files to your apache's bin directory. If it is not working in bin directory then copy it in you apache's directory.
OR
You can add c:/wamp/bin/php/php5.5.12/ in your system's PATH
I was getting the same error on Mac. I installed PHP INTL using HomeBrew.
For php 7.1 install INTL with this terminal command:
brew install php71-intl
Activate intl extension in php.ini. Use php --ini to check the configuration path.
intl.default_locale = en_utf8
intl.error_level = E_WARNING
intl.use_exceptions = 0
I added path to the PHP folder in the system PATH environment and it helped me.

Install FFMPEG on WAMP

I've probably spent over 12 hours trying to install FFMPEG on WAMP. I'm aware that other people have had this question answered on this site, however it does not work for my setup.
I have tried the below:
Download ffmpeg_new
Copy php_ffmpeg.dll from the php5 folder to the C:\wamp\bin\php\php5.2.9-2\ext
Copy files from common to the windows/system32 folder
Add extension=php_ffmpeg.dll to php.ini file
Restarted all services (Apache, PHP...)
My current setup is PHP 5.2.1, Apache 2.0.63. I have a Windows 7 64bit computer.
I get the following error in my PHP error log:
[22-Jun-2012 01:39:31] PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.2.1/ext/php_ffmpeg.dll' - The specified module could not be found.
in Unknown on line 0
Obviously I have placed the module in the ext folder.
Phpinfo.php verifies that the FFMPEG module is not being loaded. I have tried installing PHP 5.3 (with a later FFMPEG version), 5.2.6 and 5.2.9-2, but the module still fails to load. Is there anything else I should try? Does having a 64bit Windows 7 computer make any difference?
Yes, having a 64-bit computer may make a difference. Try putting the "common" files in C:\Windows\SysWow64 instead of system32.
If that doesn't work, try using DependencyWalker to check the missing DLLs (open php_ffmpeg.dll with it)
Steps to install ffmpeg:
activate GD2 Php Extension
Download ffmpeg.exe (www.ffmpeg.org)
Unpack the downloaded zip file. There will be three files inside: ffmpeg.exe, ffplay.exe, and pthreadGC2.dll
Download the FFMPEG windows dll files from
Unpack the downloaded zip file. You will need three files: php_ffmpeg.dll, avcodec.dll and avformat.dll.
Copy php_ffmpeg.dll in your wamp php extension folder: bin\php\php5.2.16\ext
Add the line "extension=php_ffmpeg.dll" (without the quotes) into php.ini right on the end of the extension= section
Copy avcodec.dll and avformat.dll and pthreadGC2.dll to C:\windows\system32
Click on the WAMP icon and click restart all services. Wait for WAMP to restart.
Copy ffmpeg.exe to C:\wamp\bin (Note: If you have installed WAMP to a different directory, copy the file to the /bin folder in your WAMP directory).
The path to FFMPEG is now: C:\wamp\bin\ffmpeg.exe
thanxxx... :)
I did the same as Manjeet Barnala but copied ffmpeg.exe, ffprobe.exe, and ffplay.exe into the Windows/System32 and my application worked then.
I think it has something to do with where your application might be pointing # the use of the exec command.
Running: PHP 7.4.0
PHP Extension gd2 confirmed initialised via going to WAMP icon and left-clicking..
WAMP > PHP > Extensions.
..and the command I was trying to execute in PHP was:
$cmd = "$ffmpeg -ss $Second -i $Filename -frames:v 1 -f mjpeg -map 0:v:0 $Thumbnail";
$return = `$cmd`;

Categories