I load an API into dll file from a software coding in C# to my web app in PHP.
I follow the install process with the extension everything seems ok
but my dll doesn't appear in my phpinfo().
Into my PHP ERROR LOG i've got this : PHP Warning: PHP Startup:Unable to load dynamic library
'c:/wamp64/bin/php/php5.6.25/ext/php_theapi.dll'
I would like to know how we check if the dll is compatible with PHP. And in Second time someone can post a method for get the entry point for the dll.
PS: I have IIS istalled and i am on MS server R8
Someone get a idea ?
Related
I am trying to get memcahe enabled on my Phpinfo().
Hi everyone, I am a newbie when its comes to working with memcache. So I have been trying to get memcache enabled on my php, but I have had very little luck.
According to my phpinfo() my php build version is API320190902,TS,VC15 and entails that I have to enable php_memcache.dll which is of the same VC (i.e VC15).
I have done that, by placing the php_memcache.dll file in my php/ext folder and enabling the extension in my php.ini by stating "extension=php_memcache.dll". But despite doing all this, I can't seem to get the memcache enabled, and my phpinfo() does not show the desired memcached section.
Additionally my Apache log states
PHP Warning: PHP Startup: Unable to load dynamic library
'php_memcache.dll' (tried: C:\xampp\php\ext\php_memcache.dll (The
specified module could not be found.)"
Can someone kindly help me figure out where I am missing it, or not doing right?
By the way, I tested this on Xampp and the .dll file was downloaded from the link https://github.com/nono303/PHP7-memcache-dll
Attached are screen shots of my Apache logs, php.ini, php/ext and phpinfo().
There are common things that are often encountered in PHP and Memcache(D) related issues:
Do you need the MEMCACHED or the MEMCACHE extension?
Is the MEMCACHED server already running? (in your case, that's not the problem yet)
Is the installed PHP extension x64 and Threadsafe compatible (as your system requires by looking at your phpinfo).
Personally, I use another PHP extension which works perfectly under PHP7 and PHP8:
memcached 3.2.0 for Windows
https://pecl.php.net/package/memcached/3.2.0/windows
Note: in addition to the usual DLL extension that you will copy to php/ext/ (and enable in your php.ini), you will also need to copy libmemcached.dll and libhashkit.dll to a directory belonging to your system path.
When I start XAMPP it gives me the following error when trying to load the SQL Server driver for PHP.
The procedure entry point _zend_hash_index_update##24 could not be located in the dynamic link library D:\xampp\php\ext\php_sqlsrv_72_ts_x64.dll.
I have tried downloading both the Microsoft SQL Server Driver 4.0 and 5.6 for php and use the php_sqlsrv_7_ts_x64.dll and php_sqlsrv_72_ts_x64.dll in the extension directory and add them to php.ini.
I found this posting related to this error:
PHP 7 on IIS: Call_user_function could not be located
In the system requirements, for MSSQL driver 4.0 it states that this driver is good for PHP 7.0+. In trying 5.6, I found this posting saying that it's support for PHP 7.3:
https://blogs.msdn.microsoft.com/sqlphp/2019/03/01/drivers-5-6-for-php-for-sql-server-released/
Either way, I still receive the same error. Is there something else I need to be checking?
In short go to https://learn.microsoft.com/en-us/sql/connect/php/microsoft-php-drivers-for-sql-server-support-matrix?view=sql-server-2017#php-version-support.
Then compare your php version against driver version in a table displayed.
Finally download a correct version, that is all.
use the 7.3 one instead (php_sqlsrv_73_...)
I was receiving this error also, trying to load php_sqlsrv_7_nts_x86 for php-7.3.8-nts-Win32-VC15-x86.
If you look at this support matrix on the microsoft site you'll see plenty of other options for drivers that support your PHP version.
I downloaded the latest, the SQLSRV561 package. That did the trick.
So Just to be clear,
I loaded php_sqlsrv_73_nts_x86.dll (from SQLSRV5.6.EXE) instead of php_sqlsrv_7_nts_x86 (from SQLSRV4.0.EXE), and that fixed the problem.
I want to install mailparser extension.
I downloaded php_malparse.dll ( put it to php/ext folder).
Also added : extension=php_mailparse.dll to php.ini
But it doesn't work, and php_info() doesn't show it too.
In logs I get:
PHP Warning: PHP Startup: Unable to load dynamic library 'E:\xampp\php\ext\php_mailparse.dll' - %1 \xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd \xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd\xef\xbf\xbd Win32.\r\n in Unknown on line 0
I need help, how can I solve this problem?
Thanks!
It's difficult to say what's going on here. Typically the message Unable to load dynamic library means the library (in this case on Windows the .dll file) is not correctly formatted and the OS was unable to map it into memory or PHP was not able to use it.
Some possible reasons include:
The extension was not compiled for the same architecture as the target PHP build (e.g. the PHP is x86-64 but the library is x86)
The extension was not compiled using the same runtime version; PHP is pretty strict about this (e.g. PHP5 is built with vc11 on Windows, PHP7 is built with vc14, ETC.)
The extension was not compiled against the same version of the PHP API or extension API used by your PHP build; typically PHP will show a more-detailed error message when this is the case (it's strange that your error message contains a bunch of non-printing characters though...)
To double-check all this, view a dump of phpinfo() to see what kind of PHP you have. Look for the PHP API and extension versions as well as the system architecture and whether thread safety is enabled. Then return to where you downloaded the php_mailparse.dll extension library and make sure the extension aligns with your PHP build. Here are some official instructions for this process for Windows PHP extensions.
I found official builds of this module here. There are a lot of different choices to pick from. Pay attention to ts (i.e. Thread-safe) vs nts (i.e. Non-thread-safe), x86 vs x64 (i.e. the architecture) and vc11 vs vc14 (i.e. the runtime version). You may have to experiment until you find one that works for your PHP build.
It might also be worth checking out the official install instructions for the mailparse extension. Note especially that the mbstring module has to be loaded first for it to work.
My system is Win7-32bit and i'm using Apache 2.4.2 and with PHP 5.4.4 by XAMPP win32-1.8.0-VC9-installer.
Recently i'm building a website for my friend's online server, and he's using Microsoft SQL Server Express 2005. I've searching many solutions about the sqlsrv.dll extension on the internet, unfortunately is it doesn't slove my problem. I had extracted the php_sqlsrv.dll extension into php/ext/ folder, and added extension=php_sqlsrv.dll in php.ini config file, but i still got the WARNING error (PHP Startup: Unable to load dynamic library 'C:\xampp\php\ext\php_sqlsrv.dll' - The specified module could not be found.) during restarting the Apache service.
Because there's too many download links on the internet and i really don't understand about the non-thread-safe and thread-safe for extensions, so for pros please give the direct links to download those extensions file which is matched with my PHP and MS SQL Server versions.
Required Extensions:
- sqlsrv.dll
- pdo_sqlsrv.dll
Of course, if there are any i need to pay attention or modify, please give your advice.
Your help would be greatly appreciated!
You'll want the "SQLSRV30.EXE" from this page. You'll need to check whether you're running thread-safe or not (use phpinfo();). The naming of the files that come out of that exe are important. You want the ones with "54" in the name. Then the "TS" or "NTS" refers to thread-safe or non-thread-safe. For more information refer to the manual.
I have downloaded a dynamic library from the location: http://downloads.php.net/pierre/.
The specific file I downloaded is: php_http-5.3-nts-svn20091125-vc6-x86.zip.
I have copied the file (php_http.dll) into the folder: C:\wamp\bin\php\php5.3.0\ext.
In php.ini, I added the line: extension=php_http.dll.
But I am getting the warning consisting of message: "PHP Startup: Unable to load dynamic library".
Do I need to do anything else to have this module enabled?
Maybe it's for a version other than your PHP's?
There are several "attributes" that must be in agreement in both the php core and the extension module. You can find all those values for the php core in the output of phpinfo()
the API version (e.g. 20090626 for the current 5.3.3 version)
is it a thread-safe (ts) or a non-thread-safe (nts) build <- this one's apparently your problem.
is it a debug build
did the compiler used to build a) the core and b) the module produce compatible code?
An extension module dll can also have additional dependencies that may or may not be fulfilled, e.g. another .dll is referenced but not present. Amongst other tools you can use ProcMon to monitor which .dlls are looked for and which are un-/successfully loaded.
For anyone that has tried the above "answers" without success, do this. Get the official Windows files from here. Make sure to (1) use the right version for your php and (2) use the right threading. Use NTS (not thread safe) if you are using fact cgi, and use thread safe if you have loaded php as an apache module.
http://windows.php.net/downloads/pecl/releases/http/
To verify it worked, look at the phpinfo() output and ensure there is a http section.