I am searching for a way to see the history of what echoed in the server. I am using GitHub webhooks and when an auto-deployment occurs a script with echo is executed. This is the code for example:
<?php
try
{
$payload = json_decode($_REQUEST['payload']);
echo 'payload is received; ';
}
catch(Exception $e)
{
echo 'no payload; ';
exit(0);
}
if ($payload->ref === 'refs/heads/development')
{ echo 'received updated in dev branch; bash/deploy_frontend2dev.sh ';
exec('sh /var/www/html/bash/deploy_frontend2dev.sh', $output);
var_dump($output);
}
else
echo 'smth is called';
I know you can see the history of commands with $ history
but when I do that it doesn't show the text that has been echoed, only the commands that have run. Is there anyway to see it? Also if you notice in the code there is a var_dump
which is also printed to the screen.
By the way, the exec that happens in the PHP script does that:
cd /var/www/html/ezmob-frontend/;
git pull origin development;
echo "pulling file from dev branch";
rm -R ../dashboard;
echo "dashboard is updated";
unzip ezmob-frontend-built.zip -d ../;
chmod 777 -R dashboard;
This should also echo some text, but yet nothing is shown.