Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

php communication with dll?

Tags:

php

dll

I need pass data (in this case just a single id) to a custom dll using php. Can you work directly with a dll in php? Having never worked with a dll before I'm not really sure how it works. Is it similar in nature to a web service or rpc?

like image 223
Ronn Avatar asked Jun 14 '11 13:06

Ronn


2 Answers

Since this is a custom DLL, perhaps you'd consider making a PHP extension?

Alternatively, PHP supports COM. If you can make a COM DLL, you're in good shape: http://us.php.net/COM

Finally, is it something that can be used with rundll32? If so, you could call it with exec().

like image 182
Brad Avatar answered Oct 08 '22 00:10

Brad


There is a number of windows specific extensions in PHP (COM, .NET, …). See the Manual for

  • http://php.net/manual/en/refs.utilspec.windows.php

One likely candidate might be the w32Api pecl extension:

This extension is a generic extension API to DLLs. This was originally written to allow access to the Win32 API from PHP, although you can also access other functions exported via other DLLs.

Most of them are marked as experimental though.

like image 33
Gordon Avatar answered Oct 08 '22 01:10

Gordon