Facebook Social Icon Twitter Social Icon YouTube Social Icon

php_mailparse.dll for PHP 5.3.x

From M.Eng. René Schwarz, Bremen/Merseburg
Jump to: navigation, search

Information icon.svg

Eine Version der Seite in Deutsch ist hier verfügbar: php_mailparse.dll für PHP 5.3.x

Information icon.svg

PHP does no longer provide builds created with Visual Studio C++ 6 (VC6). Since PHP 5.3.6 you need a version of php_mailparse.dll compiled with VC9. This version is available here.

I tried a long time to get a working binary version of the PECL extension (PECL: „PHP Extension Community Library“) mailparse for PHP 5.3.x in the Internet. As that failed, I tried to compile the searched *.dll file by myself. Unfortunately, the attempt took more time than planned. Therefore thanks to Иван Гущин, who compiled the php_mailparse.dll for PHP 5.3.x and wrote a documentation for the compilation in my order. The compiled php_mailparse.dll is published as public download.

Download and Installation of php_mailparse.dll for PHP 5.3.x

The resulting php_mailparse.dll, compiled in VC6 and against the actual PHP 5.3.5 source is publicly downloadable here. php_mailparse.dll can easily been setup as extension in PHP 5.3.x: Simply copy php_mailparse.dll to the subdirectory /ext of the PHP installation (e.g. C:\Program Files (x86)\PHP\ext) and activate the extension in the PHP config file (php.ini, usually found in the PHP installation directory, e.g. C:\Program Files (x86)\PHP). Up next there is an exemplary extract of a php.ini with activated mailparse extension:

; Dynamic Extensions ;

; If you wish to have an extension loaded automatically, use the following
; syntax:
;   extension=modulename.extension
; For example, on Windows:
;   extension=msql.dll
; ... or under UNIX:
;   extension=msql.so
; ... or with a path:
;   extension=/path/to/extension/msql.so
; If you only provide the name of the extension, PHP will look for it in its
; default extension directory.
; Windows Extensions
; Note that ODBC support is built in, so no dll is needed for it.
; Note that many DLL files are located in the extensions/ (PHP 4) ext/ (PHP 5)
; extension folders as well as the separate PECL DLL download (PHP 5).
; Be sure to appropriately set the extension_dir directive.

;extension=php_oci8.dll      ; Use with Oracle 10gR2 Instant Client
;extension=php_oci8_11g.dll  ; Use with Oracle 11g Instant Client

The extension is being activated in line 73.

Nuvola apps important.svg

mailparse requires the PECL extension mbstring (php_mbstring.dll) to be loaded before loading of php_mailparse.dll (see line 32)!

Background Story

I run on several Windows servers the e-mail ticket system Cerberus Helpdesk. This system uses mailparse to parse in- and outgoing e-mails. Until PHP version 5.2.x the neccessary php_mailparse.dll as binary for Windows systems could be found at the build page of the PHP developer Pierre Joye at this page.

Some time ago, the Windows builds have been discontinued; a long term planned buildbox for the PECL extensions for Windows systems hasn't been implemented until today. Therefore every single user has to care by his own to compile the corresponding extensions since PHP 5.3.x.

Unfortunately, even the manufacturer of the ticket system haven't been able to remedy until today. Since the missing binary of php_mailparse.dll has been a major blocker of an update to PHP 5.3.x a solution was needed.