How to run a shell script in PHP(windows)

Links for php scripts

Moderators: macek, egami, gesf

uday123
New php-forum User
New php-forum User
Posts: 5
Joined: Sat Mar 25, 2006 2:19 am

How to run a shell script in PHP(windows)

Postby uday123 » 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,
Uday.
===============

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

Postby Coditor » 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);


Coditor


Return to “PHP Scripts”

Who is online

Users browsing this forum: No registered users and 2 guests

cron