There isn’t much to go on here… ‘ls’ is a system command so of course
it works, but what in the world is ‘wol’? Has this ever worked?
Presumably you are using PHP but is this from the command line or via
Apache or even some other web server? Where is ‘wol’ on your system?
What doe sit do? It seems to take something formatted like a MAC
address for a parameter but it’d be nice to know that was proper
functionality, and really the entire thing should probably be in quotes.
Is ‘wol’ executable and placed somewhere the script or the script’s
application can find it? Tried checking Apache’s logs or doing some
basic debugging in PHP?
Good luck.
Jahegu wrote:
> Hello,
>
> I have a problem. I don’t know wy this file works:
>
>> <?php
>> system(ls);
>> ?>
>
> this print me the ls order
>
> but this another not:
>
>> <?php
>> system (wol xx:xx:xx:xx:xx:xx);
>> ?>
>
> It don’t return nothing.
>
> Please, help me, i have been trying to do it work since 2 summer…
>
> Thanks to all,
>
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
Well, I have wol installed on the system (package wol) and I suppose the OP has. It is in /usr/bin/wol, so just calling wol will pretty well execute it.
The other thing is that by reading the man wol page I can not find if it ouputs anything to stdout/stderr when it succeeds. So the question to Jahegu is:
Does your call to wol do what it is supposed to do (wake up the system with the MAC i n the NIC)? When yes, then wol has no output when no problems (not uncommon in Unix).
You could also try a call to wol without params (or another error, or wol --help) and see if the error ouput is there. Like:
henk@boven:~> wol
wol: Too few arguments.
Try `wol --help' for more information.
the problem is I used this script before but my HD fail and I reinstall all the system, and now I do agian the script but it doesn’t work. Of course if i run the instruction on the bash it works perfectly.
It may be that wol isn’t in the web server user’s PATH environment variable. I’m not sure how to edit the web server’s environment variables, but you could try providing the full path to the program.