PHP can't find dynamic library but it is on disk - php

I have to use a PHP extension called ssh2: http://php.net/manual/en/book.ssh2.php
I downloaded the sources, and compiled them. Then I copied the .dll to my php ext directory. Then I added extension=php_ssh2.dll to php.ini and I restarted Apache2 and I got the following error:
PHP Startup: Unable to load dynamic library
'C:\xampp\php\ext\php_ssh2.dll' - The specified module could not be
found
It is weird because I have php_ssh2.dll on that path. Maybe I compiled it in a wrong way?
I am using xampp, by the way. The rest of the extension load correctly.

Related

How to fix PHP Warning: PHP Startup: Unable to load dynamic library 'xxx/xxx/yaf.so'?

[26-Nov-2021 21:49:17 Asia/Shanghai] PHP Warning: PHP Startup: Unable to load dynamic library '/Applications/MAMP/bin/php/php5.6.40/lib/php/extensions/no-debug-non-zts-20131226/yaf.so' - dlopen(/Applications/MAMP/bin/php/php5.6.40/lib/php/extensions/no-debug-non-zts-20131226/yaf.so, 0x0009): tried: '/Applications/MAMP/bin/php/php5.6.40/lib/php/extensions/no-debug-non-zts-20131226/yaf.so' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')), '/usr/lib/yaf.so' (no such file) in Unknown on line 0
You are loading the incorrect version for your PHP Version.
if this is Yet Another Framework
You can only use this on the version of PHP is created for.
for example if your PHP Version is 5.3
You would need a yaf.so to match PHP 5.3
Looking on there GIT this is a 5.2 build, so your PHP Version needs to match this.
Personally i would ditch the 5.3 you are running and install 7.0.
5.3 is very dated, pointless developing anything based on this.
When you have the right version, Place this inside your ext folder in PHP.
Edit your PHP.ini file
add in:
extension=yaf.so
Ensure your extension_dir is configured correctly too:
extension_dir = "ext"
your yaf should be in the same folder as the extension dir, just ensure extension is built for the PHP version you are using, they are not cross compatible

Installing PHP 7.2 extension pdflib, module error

I am trying to install pdflib on PHP 7.2 which I already had installed before. Somehow I restructured my PHP Installation with Homebrew a while ago. Before that restructure I had my extensions in /usr/local/etc/php/7.2/extensions. I just needed to reference my .so Files in php.ini and everything had been working just fine.
After the restructure I used pecl to install new extensions. Now I have my extensions in usr/local/lib/php/pecl/20170718 which is also referenced in my php.ini as extension_dir. But if I put the pdflib.so inside this directory and register it in php.ini I get the following error:
Warning: PHP Startup: PDFlib: Unable to initialize module
Module compiled with module API=20160303
PHP compiled with module API=20170718
These options need to match`Warning: PHP Startup: PDFlib: Unable to
initialize module
How can I solve this or is there a way to roll back to the old configuration?
Module compiled with module API=20160303
PHP compiled with module API=20170718
this message indicate, that a PDFlib DSO is loaded, which was build for an older PHP (PHP 7.1).
I see two possible problems:
a different extension is loaded by accident. For example due to different names. (php_pdflib.so vs pdf.so)
your PECL build go wrong, and it was build the extension against the old PHP 7.1.
I would recommend
check your php.ini and remove all extensions with pdf
download the latest PDFlib 9.1.2 from the website and unpack the package
copy the correct DSO (php_pdflib.so) to your extension_dir
add now extension=php_pdflib.so to your php.ini
hope that helps,
Rainer

Loading dynamic library in PHP

I tried to execute this command to install Symfony on my localhost
php -r "readfile('http://symfony.com/installer');" > symfony.phar
I got an error message in my Windows machine regarding this.
The error message is PHP Startup: Unable to load dynamic library 'D:\php\php\ext\intl.so' - The specified module could not found.
It is all about the php.ini file. On windows, the dynamic library files usually do not have the extesion .so (linux library) ... you have to have .dll there... and make sure the referenced file exists.

PHP Startup: Can not find module php_pdo

I am running XAMPP v.1.8.3, on Windows 7, which shipped with PHP version 5.5.6. I manually downloaded PHP version 5.6.1 and put it in xampp/php. The old folder php I renamed to php_5.5.6. I enabled extension=php_pdo_mysql.dll in php.ini ( which was initially named php.ini-development, had to rename to php.ini ) and started getting this error when starting apache
PHP Startup: Unable to load dynamic library 'C:\xampp\php\php_pdo_mysql.dll' -
The specified module could not be found.
Then I located the extension dll and it was in C:\xampp\php\ext\php_pdo_mysql.dll, so I moved it to C:\xampp\php\php_pdo_mysql.dll but the error remains. Why isn't it finding the driver?
What is not making sense for me is that on my older version (5.5.6) the extension was also in the ext folder and not in the main php folder.
The solution was rather simple, as suggested here my extension_dir was not correct. Which doesn't explain why moving the file to the actual extension_dir would still produce this error.

Php soap extension configuration on Windows

I have a problem to configure a soap extension on windows7.
In apache acesss error:
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\VertrigoServ\Php\ext\php_soap.dll' - The specified procedure could not be found.\r\n in Unknown on line 0`
I was looking on google, and other, put some versions of soap dll files. Nothing to work. I also changed a extension dir to other.
And i also get apache error:
entry point php_output_discard could not be located in the dynamic link libary php5ts.dll
Where is a problem? I use a VertrigoServ prebuild web server.
Fixed: Need use soap .dll for right php version.

Categories