How to push text into newly created file by shell script from PHP?
<p>i used PHP site to run a shell script and it created my desired name file "result.txt" inside /opt/xampp/htdocs. However, the result.txt is totally empty, when it is supposed to have output values from the shell script. Tried on terminal, result.txt is created on Desktop and outputs are there. Tried on PHP, result.txt is created but totally no outputs are inside.</p>

<p>It's a long script so here's the first few lines:</p>

<pre><code># creates result.txt
touch result.txt

##makes the .txt read only
chmod 444 result.txt 


clear


###################################################
# This option audits the password and             #
# shadow files on the system                      #
###################################################

##option 2.1.1
echo -e "=========================================================================================" &gt;&gt; result.txt
echo "                                  SHADOWED PASSWORD CHECK                                   " &gt;&gt; result.txt
echo "=========================================================================================" &gt;&gt; result.txt
</code></pre>

<p>Anyone? </p>

<p>Thanks.</p>
