473,320 Members | 1,969 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

exec command not working

123 100+
Hey all,
I am trying to fetch the MAC address. i have written the following code,
Expand|Select|Wrap|Line Numbers
  1. $mac =get_mac();
  2. print_r($mac);
  3.  
  4. function get_mac()
  5. {
  6. exec('ipconfig/all',$output);
  7. return $output ;
  8. }
  9.  
It gives me out-put Array() .And not the whole output of ipconfig/all as i am getting while running on DOS prompt.

If i put "date" instead of "ipconfig/all" I am getting perfect answer of
Array ( [0] => Mon Jun 30 11:16:16 PDT 2008 )
But not for ipconfig , what is wrong with that ?
Jun 30 '08 #1
2 3038
dlite922
1,584 Expert 1GB
PHP does not have permission to run that command?

check that, i'm not sure,


-Dan
Jun 30 '08 #2
ajd335
123 100+
PHP does not have permission to run that command?

check that, i'm not sure,


-Dan
Hi Dan,
Dan , I have seen some examples on net , and they have used "ipconfig/all" in php like some what the same way.
One more thing, if i use
Expand|Select|Wrap|Line Numbers
  1. passthru("ipconfig/all",$output);
  2. return var_dump($output);
  3.  
then it gives me int(127) out put and if i use exec then I am getting Array() as an output..
And ya even anybody can tell me how to find MAC address with the PHP script , then i will really appreciate as I am not relaying upon just one method (i.e I have mentioned above)...
Thanks
Jun 30 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Andrew Crowe | last post by:
Hi guys, I'm having trouble executing commands using exec() or system() that need to write files. I've set the permissions on CMD.EXE but I can't use exec() to write any files, even if the...
17
by: Piotr Wolski | last post by:
can anyone help me: using exec() function in PHP i can execute linux programms like ls,who and other, however i can not execute C programms and i really don't know why. Please help me, Peter
6
by: Hal Vaughan | last post by:
I have a script used to find and run Java on a Windows system.  It worked fine on original tests (on a Windows XP system).  It's now running on a Windows 2000 (sp3) system, and it won't work -- the...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
4
by: Shailesh Humbad | last post by:
I was trying to exec a background process on XP using PHP CLI, but could not get it to work. Suppose the command I want to spawn off is "cmd". On *nix, it is as easy as putting ampersand "&" at...
13
by: inetquestion | last post by:
I've narrowed the code to a problem with php/iplanet on linux. When I run the following code from the command line "$status" comes back as "0" as it should. However when I hit it with a browser,...
21
by: comp.lang.tcl | last post by:
set php {<? print_r("Hello World"); ?>} puts $php; # PRINTS OUT <? print_r("Hello World"); ?> puts When I try this within TCL I get the following error:
1
by: rickcasey | last post by:
I wonder if anyone has experienced something like this, as it seems truly bizarre and is causing me to tear out my hair (what little there is left of it).... The exec() function just suddenly...
8
by: r0g | last post by:
Hi There, I'm trying to migrate a locally hosted page from windows to a private Ubuntu development server and one of the key bits of functionality (which used to work fine in Windows) was the...
23
by: Maarten | last post by:
Howdy, Recently I switched from a Windows PC to Mac OS-X 10.5 (php v5.2.6) and I have a little problem with one function within my cd-management script. For extracting a bit of info from my...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.