andishfr / wake-on-lan.php Goto Github PK
View Code? Open in Web Editor NEWSend magic packet from php to wake up a host using "Wake on Lan"
License: MIT License
Send magic packet from php to wake up a host using "Wake on Lan"
License: MIT License
, 'pt-PT': {
'title': 'Wake On Lan'
, 'tools': 'Ferramentas'
, 'download_config': 'Descarregar Configuração'
, 'export_config': 'Exportar Configuração'
, 'import_config': 'Importar Configuração'
, 'load_config': 'Carregar Configuração'
, 'save_config': 'Guardar Configuração'
, 'mac_address': 'Endereço MAC'
, 'p_mac_address': 'Endereço MAC aqui'
, 'ip_or_hostname': 'IP ou nome do host'
, 'p_ip_or_hostname': 'IP ou nome do host aqui'
, 'subnet': 'Tamanho máscara rede(CIDR)'
, 'p_subnet': 'Tamanho máscara rede aqui'
, 'port': 'Porto'
, 'p_port': 'Porto aqui'
, 'comment': 'Comentário'
, 'p_comment': 'Comentário aqui'
}
------------------------------------------------------------------------------------------------
, 'zh-cn': {
'title': 'wol开机'
, 'tools': '工具'
, 'download_config': '下载配置'
, 'export_config': '导出配置'
, 'import_config': '导入配置'
, 'load_config': '加载配置'
, 'save_config': '保存配置'
, 'mac_address': 'MAC-地址'
, 'p_mac_address': 'Mac-地址在这里'
, 'ip_or_hostname': 'IP-地址'
, 'p_ip_or_hostname': 'IP-地址在这里'
, 'subnet': '子网掩码'
, 'p_subnet': '子网掩码'
, 'port': '端口'
, 'p_port': '端口'
, 'comment': '主机名称'
, 'p_comment': '主机名称'
}
Hallo..
Kurze Frage ist es möglich die Daten die vom cdn Server nachgeladen sind lokal auf meinem Webserver zu laden???
Bin leider noch neu in der Materie und versuch mich daran.
Wenn ja hast du ein Tipp für mich wie ich das am besten realisiere???
Great tool. I have installed in our environment without any problem and it is working o.k.
When the page is loaded, it is constantly refreshing the hosts sate (green thumbs up and red thumbs down). This is convinient as allows the user to see if the host has been waked up but if there are many users leaving the page open, this can generate excesive traffic in the web server and LAN.
My question is: Is there a way to adjust the time interval for the refresh of the host checks ? For example, refresh the hosts state every 30 seconds or even, no automatic refresh and do it manually ?
Regards
'nl-NL': { 'title': 'Wake On Lan' , 'tools': 'Hulpmiddelen' , 'download_config': 'Download Configuratie' , 'export_config': 'Exporteer Configuratie' , 'import_config': 'Importeer Configuratie' , 'load_config': 'Laad Configuratie' , 'save_config': 'Configuratie Opslaan' , 'mac_address': 'MAC-Address' , 'p_mac_address': 'Mac-Address hier' , 'ip_or_hostname': 'IP of Hostname' , 'p_ip_or_hostname': 'IP of Hostname hier' , 'subnet': 'Subnet Grote (CIDR)' , 'p_subnet': 'Subnet Grote (CIDR) hier' , 'port': 'Poort' , 'p_port': 'Poort hier' , 'comment': 'Benaming' , 'p_comment': 'Benaming hier' , 'c_load_configuration': 'Laad Configuratie' , 'c_replace_config': '' , 'c_append_config': '' }
Feel free to use
For those running teamviewer
change to
Line: 247
$HOST_CHECK_PORTS = [ '5938' => '5938 (TeamViewer)'];
All the other ports do not work
I have this error, than i think that this script coldn't work on a hosting service
Error: Extension php_sockets is not loaded! You need to enable it in php.ini
When using this PHP script, basically anyone who could find the page, could wake up your computers.
Don't really know the impact of this (could someone exploit this?)
So, I would like have the possible to put a username/password popup or only a password popup, so not everyone could access our Wake On Lan page.
What is your thought on that ?
Considering Wake-on-lan.php might be pre PHP 8, it seems logical it is not working on PHP 8.x.
I myself had to rewrite several PHP 7 scripts to work with PHP8 again,
You get errors when saving the configuration file (alas I did not write the errors down).
I immediately installed Xamp 7.x instead and it worked.
The readme states that this does not run under linux, but I was able to get this functioning perfectly fine. The only necessary step is to uncomment the sockets extension located in /etc/php/7.4/apache2/php.ini.
extensions=sockets
It worked immediately after uncommenting that line.
Hope that might help someone.
Hello,
i have installed the Wakeonlan php on a Windows 10 Xamppp new installation.
When i now start the wakeonlan tool and klick to wakeup comes this message:
×Error 200 calling "GET ?op=wol":OK
Thx for your help.
Frank
Hi and thank you 4 this tool!
Could you tell me if it is possibile to send to 0.0.0.0 (see the attach)
If i set a network broadcast 0 the program crashes...
Thank you
i want to use your script but the ping dont work. where is your function for the ping. im beginer in code
i have error connection refused when the function send request. but my firewall is configured for dont block the ping.
i can send ping via my bash command.
Thanks for your help
ABecker
I copied your PHP script on QNAP Web folder. I can really see the page pointing to /wake-on-lan.php, but I receive the error specified in the subject "Permission Denied". Why? Isn't the user running the PHP server authorized to create raw packets?
When saving the configuration (WOL computers), the JSON file seems to stay empty, with only [ ] in the file.
After making a second WOL line the configuration seemed to be saved.
This was on Xamp with PH v7,x.
Script getting utf8_encoding() is deprecated message in PHP 8.x, not working due to it.
function endWithJsonResponse($responseData, $filename = NULL) {
if($responseData) {
array_walk_recursive($responseData, function(&$value, &$key) {
if(is_string($value)) $value = utf8_encode($value);
});
}
Needs to be changed to something like:
function iso8859_1_to_utf8(string $s): string {
$s .= $s;
$len = \strlen($s);
for ($i = $len >> 1, $j = 0; $i < $len; ++$i, ++$j) {
switch (true) {
case $s[$i] < "\x80": $s[$j] = $s[$i]; break;
case $s[$i] < "\xC0": $s[$j] = "\xC2"; $s[++$j] = $s[$i]; break;
default: $s[$j] = "\xC3"; $s[++$j] = \chr(\ord($s[$i]) - 64); break;
}
}
return substr($s, 0, $j);
}
function endWithJsonResponse($responseData, $filename = NULL) {
if($responseData) {
array_walk_recursive($responseData, function(&$value, &$key) {
if(is_string($value)) $value = iso8859_1_to_utf8($value);
});
}
Hello,
is it possible to have a direct wakeup link for a specific pc? so for instance wake_on_lan.php?pc=wakeuppcname
Thank you
Daniel
Is there a way to save the hosts that are added without have to import them?
Line 402 should have:
data-lang-pkey="p_subnet"
not data-lang-pkey="p_ip_subnet"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.