How to run a shell script in PHP(windows)

Links for php scripts

Moderators: egami, macek, gesf

Post Reply

Sun Apr 02, 2006 8:54 pm


Hi all,
I am using PHP in Windows XP.I want to run a script which generates an output file, using System function.How can I implement it?
I have tried in the following way(And open the php page using IE.).
I have configured PHP and Cygwin on windows machine.
for example:
system ('echo "I like PHP" > output' ,$retval);
It is not creating any file.
But if i do like " system ('secho "I like PHP"',$retval); " then it is printing fine on IE.
Can you please guide me.
Thanks in advance,

New php-forum User
New php-forum User
Posts: 243
Joined: Wed Feb 01, 2006 9:18 am
Location: Netherlands

Mon Apr 03, 2006 12:00 am

The fact that output isn't created, could be a permission problem. Check that the webuser has enough access to create the file wherever it's trying to create the file. If you don't know where it's going to create the file, specify that, like so:

Code: Select all

system ('echo "I like PHP" > c:\temp\output' ,$retval);

Post Reply