It compiles php to apache and apache simply does not access network uses. There are several ways for this;
1-) shell_exec;
In ubuntu you can prepare a console command that will output the network data as json, then you can run this console command in ubuntu using shell_exec in php.
2-) third part programming;
For example, you can develop scripts on platforms such as python, node js, etc. and access network usage. Again, with the software you have developed, you can instantly print the network usages to the database. In another option, you can access network information with software such as phton and show them on socket, and you can get data from php with socket. Finally, you can develop an api for this on pyhton.
2
Answers
The simplest solution is:
Better solutions depend on how often this info should be retrieved and how pretty it should be rendered in the browser.
It compiles php to apache and apache simply does not access network uses. There are several ways for this;
1-) shell_exec;
In ubuntu you can prepare a console command that will output the network data as json, then you can run this console command in ubuntu using shell_exec in php.
2-) third part programming;
For example, you can develop scripts on platforms such as python, node js, etc. and access network usage. Again, with the software you have developed, you can instantly print the network usages to the database. In another option, you can access network information with software such as phton and show them on socket, and you can get data from php with socket. Finally, you can develop an api for this on pyhton.