2

Do you know how can I call an ASP.NET .dll file from a PHP script?
Thanks!

1 Answer 1

2

You use the DOTNET extension.

First off, you need to be running this on Windows. If you are on linux, then I would look at using something like Facebooks Thrift.

If you are on windows and depending on which build of windows you are using you may need to uncomment the com extension in your php.ini

<?php
 $stack = new DOTNET("mscorlib", "System.Collections.Stack");
 $stack->Push(".Net");
 $stack->Push("Hello ");
 echo $stack->Pop() . $stack->Pop();
?>

Here are a list of Windows Specific functions

Sign up to request clarification or add additional context in comments.

3 Comments

This is definitly the way to go. Avoid COM as much as you can.
Great!, any Linux suggestions?
If you have two boxs, one running windows (containing your .net methods) the other a linux one for PHP. Then the easiest is probably exposing the methods you need using a webservice. Dotnet does make it really easy to do that. And php now has awesome SOAP support.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.