Speak now
Please Wait Image Converting Into Text...
Embark on a journey of knowledge! Take the quiz and earn valuable credits.
Challenge yourself and boost your learning! Start the quiz now to earn credits.
Unlock your potential! Begin the quiz, answer questions, and accumulate credits along the way.
General Tech Bugs & Fixes 2 years ago
Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.
Turn Your Knowledge into Earnings.
I want to run a shell script within a php webpage to check some processes running on my system (Ubuntu 12.04). Googleing I've found about shell_exec() but I can't manage to run the script when loading php.
shell_exec()
This is the php code I use.
$output = shell_exec('./dirlist.bash'); echo "$output";
$output
and the piece of html I get
<pre>pre>
Also tried $output = shell_exec('sudo -u www-data ./dirlist.bash');
$output = shell_exec('sudo -u www-data ./dirlist.bash');
dirlist.bash does ls -l (just for testing script and shell_exec)
I think it is not a permission problem. Running directory grants write and execute privileges for all users (I should be careful here).
drwxrwxrwx 4 meteo meteo 4096 mar 11 15:20 RAMS
User www-data has been added to sudoers file in case it was needed
www-data ALL = (meteo) NOPASSWD: /home/meteo/www/RAMS/dirlist.bash
Thanks in advance
No matter what stage you're at in your education or career, TuteeHub will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.
General Tech 10 Answers
General Tech 7 Answers
General Tech 3 Answers
General Tech 9 Answers
General Tech 2 Answers
Ready to take your education and career to the next level? Register today and join our growing community of learners and professionals.