tags:

views:

79

answers:

1

I have a .NET DLL containing functions that I can use in PHP. Though various PHP libraries are available, but I just wanted to know whether PHP supports libraries written in other languages? In future if I write a library in Ruby and want to use it with PHP, is it possible?

+1  A: 

It is possible though I've never done it personally:

Check out this stuff: http://us.php.net/manual/en/class.dotnet.php

Update: given your need to be on a linux server I'd think you have fewer options. You could wrap the dll in a .net webservice, only expose the objects/methods/properties you need, and run the webservice using Mono. Then you could access the dll "stuff" as you would any web service.

Also ran across this project - PHP4Mono. This may be a potential approach for you.

brendan
@brendan: My existing PHP application is hosted on Linux server. I guess using .NET DLL with the technique suggested in that link, won't work because of OS differences.
RPK
Then why did your question ask specifically for using .net? You cannot use .net outside of a windows environment. I think this person answered your question.
Kevin Peno
Right to use a .Net dll I'd assume you'd be on a windows server, you could wrap it in a web service and use mono I suppose.
brendan