Page 1 of 1
how to execute php as batch file and execute it
Posted: Tue Aug 25, 2009 8:51 pm
by sobha
Hi,
how to execute php as batch file and execute it?
Regards,
Sobha
Re: how to execute php as batch file and execute it
Posted: Tue Aug 25, 2009 9:17 pm
by ocpaul20
what system? in linux I use this in a shell script every day and it seems to work OK, but of course you have to have php installed for it to work. (obviously you place your relevant details between the { } below)
{path to php} -f (path to your phpfile you want to run} -c {path to php.ini configuration file}
Re: how to execute php as batch file and execute it
Posted: Tue Aug 25, 2009 9:27 pm
by sobha
what about in Windows?
Re: how to execute php as batch file and execute it
Posted: Tue Aug 25, 2009 9:32 pm
by ocpaul20
I think I used the windows scheduler and I tried out the commands at the cmd prompt first to make sure they worked. I have a feeling it needed quotes around the {your phpfile} part, but it was a while since I did it. I will try and look it up if I remember and if you dont get any others chipping in to answer it better than I can.
Re: how to execute php as batch file and execute it
Posted: Wed Aug 26, 2009 7:08 pm
by sobha
Hi
I used echo exec('C:/start.bat'); to execute the batch file.But it is not showing the output.
Please help.
Regards,
Sobha