0

Please help us to find right way to call .dll file in laravel 5.4

i have used use COM ; top of my controller as well and

using this type of code for excute .dll file

$obj = new COM('pathTo.dll'); 
dd($obj);

But not working

Showing error Class 'COM' not found

Please help me for resolved this problem .

2 Answers2

2

Laravel 5.4 runs on php 5.6.4.

From php 5.4.5 the COM extension is no longer in core PHP by default, so you will have to add it manually.

You can add these two lines to your php.ini file.

[COM_DOT_NET]
extension=php_com_dotnet.dll
rpm192
  • 2,564
  • 2
  • 15
  • 32
  • Thanks , but now we are facing one more issue , showing this error once we added link of dll file in function Error : ---> Failed to create COM object `C:\Windows\Microsoft.NET\assembly\GAC_MSIL\EntraPassUtility\v4.0_1.0.0.2__ecc8607640d67af4\EntraPassUtility.dll': Bad extension for file – Deepak Goud Dec 19 '18 at 08:57
0

You might be able to use shell_exec() to get what you need (note: IUSR might need permissions to directory that the DLL is in).

$processID = shell_exec("C:\\Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\EntraPassUtility\\v4.0_1.0.0.2__ecc8607640d67af4\\EntraPassUtility.dll 2>&1 &");
exec('ps ' . $processID, $processState);

Otherwise, here are a few other articles that might be of assistance:

cfnerd
  • 3,198
  • 12
  • 28
  • 39