How to make a shell file create a php page

Asked

Viewed 28 times

1

I’d like to make a MIB (Management Information Base), which is created, and I have to create the manager and the agent. I am using shell to do this, in the agent I have to create a page in PHP, to display the information of MIB, someone could help me?

I use the interpreter bash.

1 answer

0

something like

#!/bin/bash

cat << EOF > /var/www/html/teste.php
<?php
  echo "Funcionou?";
?>
EOF

should work.

  • my biggest doubt is the following, the PHP page I should do outside of bash or on it?

  • depends on what you want to do. At the moment I can’t imagine a case where you actually need to use bash to generate a php. I would try to use shell_exec php before using bash.

  • you have some example that I can use, is that my teacher came with this MIB and I can not find anything on the net, he wants a manager to do the php part then will receive the information from MIB, who are in manager

  • and another thing, I’m very weak in shell :(

Browser other questions tagged

You are not signed in. Login or sign up in order to post.