Unity.exe -executeMethod with PHP

Hello :slight_smile:

I’m trying to launch the following commandline using a PHP script:

"C:\\Program Files (x86)\\Unity\\Unity.exe" -batchmode -executeMethod DBExecCreator.BuildPlayerFromDB

The goal being to execute the method, it works when i put this very line in a .bat file and launch it.

It doesn’t work with php:

exec('"C:\\Program Files (x86)\\Unity\\Unity.exe" -batchmode -executeMethod DBExecCreator.BuildPlayerFromDB');

or

exec('cmd.exe /c "Scripts\\myBat.bat"' );

I found this but i couldn’t solve it by giving full control over the unity folder to all users.

I know that PHP isn’t the main language in this community (thanks god !) but if anyone already encountered a similar problem, please let me know =)

Thank you for reading.

<?php $torun = file("yourcodestring.txt"); if(file !== null){ exec("yourcommandfile.cmd", $torun); } echo implode(" ", $torun); ?>