PHP install mailparser extension - php

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.

Related

How to get memcache to work on php with Windows

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.

How does one build WINCACHE .DLL from source files?

I downloaded WINCACHE-1.3.7.4.tgz from the PECL download page. Unpacking it i find many a C orientated source file. Compiling from source in Linux i have some experience in BUT none at all in Windows (i am running Windows 7).
The instructions on PHP.net's WinCache pages does not seem to match the files extracted from the `.tgz'
I have looked at suggested questions
Creating Windows DLL from C++ source files
Creating php DLL from pecl source files
but i have NO idea where to actually start off.
And thus, does anyone know how i would build WinCache .DLL from the provided source? (if at all easily possible)
Do you really need to build this extension from source? If not, you can download precompiled DLLs here. If yes, you have to follow this tutorial for compiling PHP extension on Windows. Basically, you have to build PHP and it will also compile extension that you will enable. After successful compilation you should be able to find required dll and use it with your running PHP.
But another question is for what do you need it? What version of PHP do you use? If 5.5+ you should consider OPCache instead WinCache.
Since the Zend Opcache extension is now in the core PHP product, the WinCache opcode cache is disabled by default. As of PHP 5.5, the opcode cache portion of WinCache is deprecated, and will be removed in a future release of the WinCache extension.

php startup :unable to load dynamic library

i am getting warning php startup:unable to load dynamic library 'C:/wamp/bin/php/php5.5.12/ext/php_intl.dll'-%1 is not a valid Win32 application
how to sole this.
That is due to invalid dll file.
first you need to find
Architecture - 32 bit ot 64 bit
compiler version - VC9 or VC11
Thread safe or Non thread safe
this can be find by open phpinfo or echoing phpinfo() in any php file.
then search for Compiler,Architecture and Thread Safety
then go to http://windows.php.net/download/ and download right Releases.
replace needed file then restart web server

Mismatch between Php and Extension module

I am trying to install the following php extension. Microsoft Drivers for SQL Server for PHP.
I have tried both versions of the driver but both seem to mismatch the version of php i am running. I looked around and it appears I have to recompile the modules in order to match the php api version. But I don't have any idea how to do this.
Any ideas on how to make this work? Or maybe a simpler way to use PHP 5.4.7 to access SQL.
You can do it with some tricks, its not recommended but it will work fine and in my case, it has not crashed yet :)
Check your phpinfo() page for:
1-PHP extension API Number
2-Thread safe or non-thread safe version
3-(Windows) compiler version
1-For building your extension you need php.lib. It is in your PHP-server dev directory.
2-You need PHP header files for compiling your extension, after including PHP header files, go to PHP/Zend directory and open zend_modules.h file and change the #define ZEND_MODULE_API_NO 20060613to your PHP extension API number for example change it to #define ZEND_MODULE_API_NO 20090626.
3- If you use windows based servers the compiler version is important(VC8 - VC10), if your PHP was compiled with VC8, build the extension in VS2008 or use VC8 for building your project.
If you encounter any wired error just comment it. I spent 3 months to make this worked ;)

Problem loading dynamic library in WAMP

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.

Categories