Today's Posts Follow Us On Twitter! TFL Members on Twitter  
Forum search: Advanced Search  
Navigation
Marketplace
  Members Login:
Lost password?
  Forum Statistics:
Forum Members: 24,254
Total Threads: 80,792
Total Posts: 566,472
There are 1639 users currently browsing (tf).
 
  Our Partners:
 
  TalkFreelance     Design and Development     Programming     PHP and MySQL :

PHP system commands

Thread title: PHP system commands
Closed Thread    
    Thread tools Search this thread Display Modes  
10-03-2005, 10:20 AM
#1
ktsirig is offline ktsirig
Status: Junior Member
Join date: Oct 2005
Location:
Expertise:
Software:
 
Posts: 46
iTrader: 0 / 0%
 

ktsirig is on a distinguished road

  Old  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!

10-03-2005, 10:51 AM
#2
UrlTrends is offline UrlTrends
UrlTrends's Avatar
Status: Junior Member
Join date: Jan 2005
Location: Sacramento, CA
Expertise:
Software:
 
Posts: 68
iTrader: 0 / 0%
 

UrlTrends is on a distinguished road

  Old

Commands like 'ls', 'cd', etc. are Unix specific (Linux, FreeBSD, SuSe, etc.). You can use the exec and system commands, but you need to "windowize" the command that you are running. For example the 'ls' command is the same as the 'dir' command in windows.

For example:

Code:
ls /
is equivilant to:

Code:
dir c:
In regards to being able to use these commands, make sure that safe mode isn't enabled and that you have permission to perform the commands.

It will be easier to go to "Start => Run => Type 'cmd[enter]'" For the command prompt you will be able to test out commands, then just type those into the exec command.

10-03-2005, 12:16 PM
#3
ktsirig is offline ktsirig
Status: Junior Member
Join date: Oct 2005
Location:
Expertise:
Software:
 
Posts: 46
iTrader: 0 / 0%
 

ktsirig is on a distinguished road

  Old

Thanx Joel, I tested it and you're right!

10-03-2005, 12:23 PM
#4
UrlTrends is offline UrlTrends
UrlTrends's Avatar
Status: Junior Member
Join date: Jan 2005
Location: Sacramento, CA
Expertise:
Software:
 
Posts: 68
iTrader: 0 / 0%
 

UrlTrends is on a distinguished road

  Old

Originally Posted by ktsirig
Thanx Joel, I tested it and you're right!
No problem. However, I was a little disturbed to see your exact post on another forum shortly after I answered it here for you. Pick the forum most appropriate for the question and post it once. If you don't get a response within a day or so then maybe post it elsewhere. So, try not to do that.

Closed Thread    


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

  Posting Rules  
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump:
 
  Contains New Posts Forum Contains New Posts   Contains No New Posts Forum Contains No New Posts   A Closed Forum Forum is Closed