Today I have migrated my XAMPP's internals to 64bit:
Apache (from 32bit 2.4.25 to 64bit 2.4.27)
PHP (from 32bit 7.1.4 to 64bit 7.1.9)
I have downloaded each extension used before in 32bit, installed, configured (copy&paste mostly with path changes if needed) and generally everything "works".
-> % php --version
PHP 7.1.9 (cli) (built: Aug 30 2017 18:34:46) ( ZTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
But somehow I get PHP Startup: Unable to load dynamic library errors even if there are valid DLLs (most of them bundled in downloaded PHP package). These are curl, intl, ldap and imagick (the last one is installed by me). Paths are correct in php.ini (many other extensions are loaded properly from the same directory). This is what I get in php_error_log every time when I access page through Apache:
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_curl.dll' - The specified module could not be found.
in Unknown on line 0
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_intl.dll' - The specified module could not be found.
in Unknown on line 0
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_ldap.dll' - The specified module could not be found.
in Unknown on line 0
[22-Sep-2017 15:52:47 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'D:\Bin\XAMPP\7.0.9\php\ext\php_imagick.dll' - The specified module could not be found.
in Unknown on line 0
In CLI everything is fine (it's the same php.ini as for Apache):
-> % php -i | grep -n3 curl
175:curl
178-cURL Information => 7.55.0
-> % php -i | grep -n3 ldap
347:ldap
349-LDAP Support => enabled
350-RCS Version => $Id: 0779387e5f88edc656159d12b9302a053e82cc79 $
-> % php -i | grep -n3 intl
330:intl
332-Internationalization support => enabled
333-version => 1.1.0
335-ICU Data version => 57.1
but in Apache I have Attempted to call function "curl_init" ... error :(
Any ideas?
I had the same problem on Windows 10 and solved it by adding the php home directory to the system (NOT user!) PATH environment and rebooting the system.
When Apache is installed as a service it is run as a system user which means it does not see your user environment variables.
it's basically 404'ing the dll's. either the user that apache runs as, doesn't have permissions to read the folder D:\Bin\XAMPP\7.0.9\php\ext\ , or the folder doesn't exist. as for why it works in cli but not in apache, they're probably reading different php.ini's , but it could also be that php-cli runs as a different user account. to check that, run php -r 'phpinfo();' | grep -i username in cli, and a page with <?php phpinfo(); and look for "Enviorment" > "User" in apache phpinfo(); , the pages will also tell you if they're loading the same php.ini file.
and nothing of this has anything to do with programming, so i say again, this should be on serverfault.com or something, not stackoverflow.com
Check if your DLL's are in proper version. There is quite often difference between x64 and x86 version, also between ZTS and NON TREAD SAFE. For some reason instead of nice error message of ddls being incompatible you will only get information: cannot load extension.
Well, this is weird but the root problem of this issue was... using Apache as service. I can't explain why, but when running Apache as service these extensions could not be loaded, but when running without service, using only "Start" from XAMPP control center, all is working fine with the same config and directory/file structure.
I realized that when I wanted to back to my previous working versions and I linked 32bit versions again (I use apache and php symlinks in XAMPP installation dir). cURL was not loaded, but it was working before migrating to 64bit. So I started digging and experiment with service and after unregistering it started working correctly. So I thought it could be the case with 64bit too... And it was.
Now I can start Apache properly. There is still minor issue because XAMPP control panel doesn't show Apache as running after clicking "Start", but processes are there and is working. But most important is everything is OK under the hood.
I had the same problem. All extensions loaded except these two: amqp and pdo_sqlite:
PHP Warning: PHP Startup: Unable to load dynamic library 'pdo_sqlite' (tried: D:\\xampp74\\php\\ext\\pdo_sqlite (The specified module could not be found.), D:\\xampp74\\php\\ext\\php_pdo_sqlite.dll (The specified module could not be found.)) in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library 'amqp' (tried: D:\\xampp74\\php\\ext\\amqp (The specified module could not be found.), D:\\xampp74\\php\\ext\\php_amqp.dll (The specified module could not be found.)) in Unknown on line 0
One solution is so add the php path to your environmental variable PATH.
The real problem here is that although extension dlls live in xampp\php\ext, some extensions have additional files that are located in xampp\php. These additional dlls are the ones that can not be loaded if the php path is not added to your PATH.
If you do not want to add the PHP path to your PATH, the solution is to add the extra dll files to the xampp\apache\bin folder (copy, not move). In my case:
libsqlite3.dll for pdo_sqlite
rabbitmq.4.dll and rabbitmq.4.pdb for php_amqp
Or, if you start apache via a batch file, add the php path before starting apache:
SET PATH=%PATH%;d:\xampp74\php
Related
I am trying to run a yii project which I copied from server. The project is running fine on live server.
I installed wamp for that purpose, and using composer installed all packages. The project is using advanced yii template, when I goto http://localhost/nz-tool.nztours.de/backend/web/ to run backend index page. I get the following error
Invalid Configuration – yii\base\InvalidConfigException MemCache
requires PHP memcache extension to be loaded.
Btw I am new to yii and php, so I maybe missing some configuration. Upon googling I found out that php_memcached.dll dll is missing. I copied and put it in the right folder C:\wamp64\bin\php\php7.4.26\ext and updated php.ini, even tried changing php versions. But still memCached dll is not loading.
When I run php --version, it complains of missing php_memCached.dll file.
Warning: PHP Startup: Unable to load dynamic library 'php_memcached.dll' (tried: c:/wamp64/bin/php/php7.4.26/ext/php_memcached.dll (The specified module could not be found.), c:/wamp64/bin/php/php7.4.26/ext/php_php_memcached.dll.dll (The specified module could not be found.)) in Unknown on line 0
PHP 7.4.26 (cli) (built: Nov 16 2021 18:15:31) ( ZTS Visual C++ 2017 x64 )
Copyright (c) The PHP Group
Zend Engine v3.4.0, Copyright (c) Zend Technologies
I also followed this guide to install memcache service.
Additional info:
I have tried xamp and still same issue.
Please check if you copied the memcached DLL file to the correct location.
Your PHP warning says something about
c:/wamp64/bin/php/php7.4.26/ext/php_php_memcached.dll.dll
and looked for
c:/wamp64/bin/php/php7.4.26/ext/php_memcached.dll
and in php.ini file, these configurations need to be set
extension=php_memcache.dll
[Memcache]
memcache.allow_failover = 1
memcache.max_failover_attempts=20
memcache.chunk_size =8192
memcache.default_port = 11211
My PHP Version 7.2.1 and Architecture is x86 and System is Windows 10 64 bit so I have downloaded chilkat-9.5.0-php-7.2-nts-win32 from https://www.chilkatsoft.com/php.asp#winDownloads
and extension DLL file added into my C:/xampp/php/ext such as "C:/xampp/php/ext/chilkat_9_5_0.dll" and updated my php.ini as well
But PHP is throwing startup warning and chilkat extension is not working for me could you please guide me where is i am wrong.
My php.ini
extension_dir="C:\xampp\php\ext"
extension=chilkat_9_5_0
PHP Error
PHP Warning: PHP Startup: Unable to load dynamic library 'chilkat_9_5_0' (tried: C:\xampp\php\ext\chilkat_9_5_0 (The specified module could not be found.
), C:\xampp\php\ext\php_chilkat_9_5_0.dll (The specified module could not be found.
)) in Unknown on line 0
well first of all you need to find if your PHP is NTS (None Thread Safe) or TS (Thread Safe) by phpinfo()
as you can see thread safety is enabled which means that PHP is TS
and my PHP version is 7.2.34 x64 which means that i have to download
chilkat PHP 7.2.* (thread-safe) x64
after installation place chilkat_9_5_0.dll in (C:\xampp\php\ext)
if you are using xamp my default require() is at (C:\xampp\php\pear)
so move chilkat_9_5_0.php to (C:\xampp\php\pear)
in the php.ini search for dynamic extension and below add ( extension=chilkat_9_5_0.dll ) with the .dll
restart XAMP and test it with the given test.php file in the downloads and it should work
I have manually installed Apache and PHP on my server and it has to connect to the sql server 2012 for DB. My configurations are as below:
Apache 2.4.23 VC11 x64 installed on E:\
PHP 7.0.12 VC14 x64 installed on e:\
I have installed the srv dlls from the microsoft website.( SQLSRV40.exe). Also I have installed the msodbcsql dll and the sql native client (both 64bit) , but while I run these two .exe it gets installed on to the default path which is c:\
I have enabled the php_errors and I could see that php is working fine with the phpinfo() but on the phpinfo() i dont see the sql.dll files being picked up. More over the php_error file throws the error:
"[01-Nov-2016 12:14:58 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'E:/php/ext/php_sqlsrv_7_ts_x64.dll' - The specified module could not be found.
in Unknown on line 0
[01-Nov-2016 12:14:59 UTC] PHP Warning: PHP Startup: Unable to load dynamic library 'E:/php/ext/php_sqlsrv_7_ts_x64.dll' - The specified module could not be found.
in Unknown on line 0"
Am not able to figure out what went wrong, Could some one help me out, please
You can simply move the .dll files from C:\ to E:\php\ext\ (copy & paste).
Alternatively you can alter the path in the php.ini file which should also be in E:\php.
It might be helpful if you search for all files containing the text php_sqlsrv_7_ts_x64 then you know where they are actually loaded.
I installed the recent versions of xampp for windows and yaml on my PC with windows 8.1 64bit.
The versions were
xampp-win32-7.0.9-1-VC14-installer.exe
php_yaml-2.0.0rc8-7.0-ts-vc14-x86.zip
I put the line of extension=php_yaml.dll to the end of php.ini file.
I copied php_yaml.dll to C:/xampp/php/ext folder.
I copied yaml.dll to C:/xampp/apache/bin folder.
phpinfo(); command displayed that yaml was enabled.
But bad warning still appeared on command prompt when typing php command:
$ php
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_yaml.dll' - The spec
ified module could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_yaml.dll' - The specified
module could not be found.
in Unknown on line 0
See it on screenshots:
How to fix it?
Add ;C:\xampp\apache\bin to PATH Windows environment variable.
I fixed mine by downloading the correct version of yaml. The yaml Version has to match the installed PHP version. Make sure that you match the thread-safe and non-thread-safe option with your PHP aswell.
How to check if your PHP is thread-safe
I can't believe this hasn't been asked before, but here goes:
I'm trying to install xdiff on Windows (64-bit) using WAMP and PHP version 5.3.
pecl.php.net doesn't offer a .dll file for this combination so I tried downloading the 5.3 x86 files and the 5.5 x64 versions, but neither worked. The x86 version generated the following warning in the apache logs:
[Thu Jun 05 15:55:47 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.13/ext/php_xdiff.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.13/ext/php_xdiff.dll' - %1 is not a valid Win32 application.
in Unknown on line 0
The x64 version generated this warning:
[Thu Jun 05 15:58:16 2014] [warn] Init: Session Cache is not configured [hint: SSLSessionCache]
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.13/ext/php_xdiff.dll' - The specified module could not be found.\r\n in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.13/ext/php_xdiff.dll' - The specified module could not be found.
in Unknown on line 0
At that point, I went back and read the readme file a little more closely and discovered the following line:
This extension requires libxdiff (http://www.xmailserver.org/xdiff-lib.html).
Okay, fair enough. Following the advice on this page I compiled libxdiff but then I got to the step that read
Once compiled you need to copy all the headers and libraries into the appropriate PHP library directories.
And I have no idea what the "appropriate PHP library directories" are nor what files I'm supposed to be copying, nor even if the missing libxdiff is the problem (or if the real problem is that the .dll file I'm using is just incompatible with PHP 5.3 x64 and I should be trying to compile the PECL extension instead of libxdiff).
Does anyone have any advice?
OK, by virtue of this message I assume you are runnning the 32bit Wampserver. Thats ok, 32 code runs on a 64bit OS, but not the other way round.
PHP Warning: PHP Startup: Unable to load dynamic library 'c:/wamp/bin/php/php5.3.13/ext/php_xdiff.dll' - %1 is not a valid Win32 application.\r\n in Unknown on line 0
So you will need to download the 32bit version of php_xdiff
Because of the way WampServer configures Apache & PHP you will need the Thread Safe dll i.e. download filename contains -ts- and not -nts-
As you are trying to add this to PHP5.3.x you will probably need the version compiled with VC9 unless PHP5.3.you_dont_specify is so old it is compiled with VC6 in which case I am not sure where you can get a version from. In that case you may be looking at upgrading you Apache and PHP version at least.
php_xdiff from here
pecl dependancies compiled libraries from here, like libxdiff
Complementary to what RiggsFolly has already posted, which is correct, please keep in mind that you need to include xdiff in your php.ini file to be able to use xdiff* functions in Wamp.
This can be tricky, because there are actually two php.ini files in your wamp\bin\php directory. One is called php.ini and the other is called phpForApache.ini, and the active one is the one called phpForApache.ini (or at least that's how it is on my set-up)
To include the xdiff extension, you need to search the php.ini file for extension= and add the xdiff extension, like so:
PHP 7.1 or earlier
extension=... (other extensions)
extension=php_xdiff.dll
PHP 7.2+
extension=... (other extensions)
extension=xdiff