Run PHP from the command line in the background

0

I am using the programmed windows tasks to execute a PHP file every X time, the thing is that when executing the program screen is put and then I want it to be in the background ... The first task I did was this:

C:\xampp\php\php.exe -f c:/xampp/htdocs/tarea.php

The next thing I wanted to try was to run the CMD in the htdocs directory and use > NUL 2> & 1 to run in the background, the thing is that I did not know how to do so that when the cmd is opened with the task scheduler, it sends PHP tarea.php Automatically ... I appreciate any help either for the first case, the second or some other way.

    
asked by Andy Samuel 09.08.2018 в 02:34
source

1 answer

1

I've already solved it, it's very simple. In the scheduled task, on the General tab, a part called "Security Options" appears with the user who is executing the task. You must click on the "Change user or group" button, in the text box type "SYSTEM" , accept it and that's it. I hope it is useful to anyone who has the same doubt as I spent most of the afternoon looking for a way to fix it. :)

    
answered by 09.08.2018 / 04:52
source