hello, i would lilke to create a page with links that will run sh files (bash scripts), for personal use.
I have installed lampp on my linux machine and able to run php files on it.
I'm not familiar with php and had no luck so far with getting it done.
Thank you.
run bash scripts with php
Moderators: egami, macek, gesf
An html file to run the php in a link
and the php file
and finally the sh file which just prints out a line in the terminal.
But nothing happens when i press on the link
Code: Select all
<html>
<title></title>
<a href="2.php">run tmp.sh</a>
</html>
Code: Select all
<?
exec('sh tmp.sh');
?>
But nothing happens when i press on the link
#!/bin/sh
/usr/bin/php test.php
wait
/bin/bash test.sh
wait
/usr/bin/php test2.php
wait
/bin/bash test2.sh
wait
echo all done
hire php developer | hire magento developer
/usr/bin/php test.php
wait
/bin/bash test.sh
wait
/usr/bin/php test2.php
wait
/bin/bash test2.sh
wait
echo all done
hire php developer | hire magento developer