0
Good morning, everyone,
As stated in the title, I need to access windows cmd.exe through Wampservere and run a .bat. I did the following Cód. php to run the above:
<?php
$batname = "chamaCalc.bat" ;
$output = shell_exec("c:\\windows\\system32\\cmd.exe /c $batname");
echo $output;
?>
I was successful with my need in Xampp, but in Wampserve, nothing happens. Does anyone know if there’s any way this works at wamp?
Thank you!
Does it matter where the line " safe_mode_exec_dir = off " is defined within php.ini? I set this parameter on the last line of the file but it didn’t work. :(
– user145547
So normally this line already exists, no need to add
– ScrapBench
This line did not exist in my php.ini =(
– user145547
I know there is also an option on the icon on the taskbar that enables or disables host interactions, let me inform you a little more because I no longer have wamp installed
– ScrapBench
Then other things to check would be Wamp running as administrator If you changed apache2 php.ini and not the one in php Also check that in the php file there is no 'disable_functions' line with these functions marked I tried here on my side and it worked after adding 'safe_mode_exec_dir = off'
– ScrapBench
I tried everything you said, but it doesn’t work. My wampserver php is 7.2.18. I don’t know if this can influence anything.
– user145547