Run PHP file from Bash
<p>I need to run a script that will execute a php file but I can't run the PHP file from Bash Script</p>

<p>Test.sh:</p>

<pre><code>#!/bin/sh
php /home/username/public_html/Test3/Test.php
</code></pre>

<p>Where is the error?</p>

<p>/var/log/cron :</p>

<pre><code>Sep  7 22:56:01 srv CROND[4344]: (root) CMD (sh /home/Username/public_html/Test3/test.sh)
</code></pre>

<p>Test.php</p>

<pre><code>&lt;?php
$servername = "localhost";
$username = "";
$password = "";
$dbname = "";

try {
    $conn = new PDO("mysql:host=$servername;dbname=$dbname", $username, $password);
    $conn-&gt;setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
    $date = date('h:i:s');
    $sql = "UPDATE deneme SET CRONTEST='".$date."' WHERE id=1";

    $stmt = $conn-&gt;prepare($sql);

    $stmt-&gt;execute();

    echo $stmt-&gt;rowCount() . " records UPDATED successfully";
    }
catch(PDOException $e)
    {
    echo $sql . "&lt;br&gt;" . $e-&gt;getMessage();
    }

$conn = null;
?&gt; 
</code></pre>