Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Oct 3rd, 2005, 5:17 AM   #1
ktsirig
Programmer
 
Join Date: Oct 2005
Posts: 54
Rep Power: 3 ktsirig is on a distinguished road
PHP system commands

Hi all!

I want to execute system commands through the functions provided by PHP (like exec, system etc)

In the LINUX machine in my work, everything seems to be OK, when, for example, I write system `ls`; and I print it on the screen.
In my home PC on the other hand, where I have winXP and the Cygwin platform installed, none of these works.

1) Is the Cygwin platform sufficient to run system commands or must I have LINUX machine?

2) Do I need to change anything in my php.ini file in order to 'activate' the system commands?

Thanx!
ktsirig is offline   Reply With Quote
Old Oct 3rd, 2005, 6:45 AM   #2
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
The systems have different commands. 'ls' would need to be 'dir' on a Windows machine or you'd need aliases. Arguments would no doubt vary to some extent, also. If your PHP app is in a client/server relationship with the client issuing system commands through interaction, you're in a very insecure situation.
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Oct 3rd, 2005, 6:57 AM   #3
tempest
Programming Guru
 
tempest's Avatar
 
Join Date: Oct 2004
Posts: 1,041
Rep Power: 5 tempest is on a distinguished road
Send a message via ICQ to tempest Send a message via AIM to tempest Send a message via Yahoo to tempest
The system execution commands have also been seen by me, and a few other people, to have issues with Windows XP. Are you testing your php script in a Cygwin Linux environment, or on the windows one?
__________________

tempest is offline   Reply With Quote
Old Oct 3rd, 2005, 7:15 AM   #4
ktsirig
Programmer
 
Join Date: Oct 2005
Posts: 54
Rep Power: 3 ktsirig is on a distinguished road
Yes, you are right.
I used `dir` and it worked fine..
So I guess I can't easily communicate with windows as I can with Linux ...

Thanx for your time!
ktsirig is offline   Reply With Quote
Old Oct 3rd, 2005, 5:33 PM   #5
BlazingWolf
Hobbyist Programmer
 
Join Date: Sep 2004
Posts: 207
Rep Power: 4 BlazingWolf is on a distinguished road
Of course not. :p
__________________
_______________________________
BlazingWolf
BlazingWolf is offline   Reply With Quote
Old Oct 3rd, 2005, 11:13 PM   #6
addmachina
Newbie
 
addmachina's Avatar
 
Join Date: Sep 2005
Posts: 3
Rep Power: 0 addmachina is on a distinguished road
detect the os first

after detecting the os, then customize your system commands... (i hope it works)
__________________
[PHP]phpinfo();[/PHP]
http://macki.wibelib.com
addmachina is offline   Reply With Quote
Old Oct 4th, 2005, 1:24 AM   #7
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 5 bl00dninja is on a distinguished road
yeah, after hearing that two completely different operating systems use different commands i'm still scratching my head...?

why couldn't leibniz simultaneously come up with newton's notation? i like that one better. (albeit somewhat less descriptive)

:p
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:15 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC