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
Related
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
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
OS: Windows 8.1
Arch: x64
php: PHP 7.1.6
mssql: Mssql Server 2014 express
driver: SQLSRV 4.0
IDE: PhpStorm
I'm trying to get mssql drivers to work.
I downloaded the pdo driver from microsoft, put the file php_pdo_sqlsrv_7_nts_x64.dll into C:\Program Files\PHP\ext and edited php.ini to add extension=php_pdo_sqlsrv_7_nts_x64.dll to it.
This is the result:
$ php -v
PHP Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_pdo_sqlsrv_7_nts_x64.dll' - The specified procedure could not be found.
in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library 'C:\Program Files\PHP\ext\php_sqlsrv_7_nts_x64.dll.dll' - The specified procedure could not be found.
in Unknown on line 0
PHP 7.1.6 (cli) (built: Jun 8 2017 01:53:41) ( ZTS MSVC14 (Visual C++ 2015) x64 )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.1.0, Copyright (c) 1998-2017 Zend Technologies
Probable duplicate of this:
PHP Warning: PHP Startup: Unable to load dynamic library php_pdo_mssql.dll
But that one's never answered and four years old.
In my case, this error (but with a different DLL version) was caused by adding the wrong PHP SQL SLQSRV DLL to my PHP extensions:
I am using PHP 7.2.21 from XAMPP.
I added these DLLs (included in SQLSRV561.exe):
php_pdo_sqlsrv_72_ts_x64.dll
php_pdo_sqlsrv_72_ts_x86.dll
php_pdo_sqlsrv_72_nts_x64.dll
php_pdo_sqlsrv_72_nts_x86.dll
I enabled php_pdo_sqlsrv_72_nts_x64.dll as PHP extension, but the nts dll version was the wrong one for my PHP version. When I enabled the ts dll version, the error disappeared. ( I am using IIS.)
Thread Safe (TS) and Non-Thread Safe (NTS) are the two different PHP
builds available.
It's a good idea to look at the release information.
That way you can see what version it supports.
https://github.com/Microsoft/msphpsql/releases
In my case the mssql driver is still one minor version behind php's latest stable version, so I have to downgrade my php from 7.1 to 7.0.
Is your PHP version thread-safe? You are using the library for this version, you can use "php -i|find "Thread" from command line in windows.
I tried this using PHP732 on windows server 2019 with IIS10 using the php_pdo_sqlsrv_73_nts_x64.dll, works just fine without issue. It gives warning if I enable 73_ts_x64.
I a running a local development environment on my MBP using osx yosemite, php 5.5.14, apache 2.4 mysql (sometimes) and a few things installed via brew.
I tried to run a CMS locally and ran into an issue where it stated i needed mcrypt; so i tried to install it and was promptly tole mcrypt was already installed.
Did a little research, tried to reinstall it and now I'm faced with this error when running php -v. Also this has stopped m dev enviroment from showing me my site and all it says now is 'it works!'
PHP Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so' -
dlopen(/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so, 9): image not
found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library
'/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so' -
dlopen(/usr/local/Cellar/php55-mcrypt/5.5.21/mcrypt.so, 9):
image not found in Unknown on line 0
PHP 5.5.21 (cli) (built: Feb 12 2015 20:17:17)
Copyright (c) 1997-2014 The PHP Group
Zend Engine v2.5.0, Copyright (c) 1998-2014 Zend Technologies
Any help would be very appreciated and thanks in advance.
Make sure that you're loading the mcrypt.so extension in your php.ini file. Also, you may need to run brew install mcrypt php55-mcrypt to get the PHP extension.
Find the location of your ini with:
php -i | grep php.ini
Edit the file and add extension=mcrypt.so to the file, save and restart Apache.
I've recently installed phc, the php compiler. I started out installing LAMP from source with --enable-so for Apache and --enable-embed for PHP5 (among other options these are most relevant to the installation and later configuration).
When I finished installing I realized phc does not yet support PHP5.3 so I uninstalled it and installed PHP5.2. phc works fine now, as does the PHP client application for the commandline. Apache seems to be running fine, too, when I comment out line 193 (see below). It just doesn't parse PHP.
httpd: Syntax error on line 193 of /etc/apache2/conf/httpd.conf: Can't locate API module structure `php5_module' in file /usr/local/lib/libphp5.so: /usr/local/lib/libphp5.so: undefined symbol: php5_module
When I check my version of PHP from the terminal I get the expected output (5.2):
[root#localhost conf]# php -v
PHP 5.2.14 (cli) (built: Sep 7 2010 22:50:25)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
I made sure to move the libphp5.so file from the folder where I built php5.2 (/usr/local/src/php-5.2.14) to /usr/local/lib. I also moved php.ini to /usr/local/lib.
Is there something I'm missing here?
OK!
Apparently when you configure PHP it's important to include the line specifying wehre to find apxs for the proper installation:
--with-apxs2=/etc/apache2/bin/apxs
I did this and the problem vanished :)