Problem with running system, exec, shell_exec, passthru with Apache
Posted by: kitaryan (---.sssnet.com)
Date: March 02, 2015 11:32PM

In WAMP I have a PHP file that is finding a batch file consisting of a scheduled task.

The task runs fine when executed outside of PHP.

I need the task to run via PHP so I have set the task up so that it runs as follows:

if(file_exists('mytask.bat')){

system('mytask.bat');

}

Apache creates this error:
ERROR: No mapping between account names and security IDs was done.

(39,4):LogonType:

When I change the services to have a user account. The script will run and work correctly, however, the script never stops running and will only work correctly on the first run without any errors.

Is there any solution to this without having to go to a 3rd party solution?

Am I able to assign an owner to Apache without the script running indefinitely?

Thanks for any help or information on this.

Options: ReplyQuote


Sorry, only registered users may post in this forum.