从php中的不同目录运行bash脚本

I'm trying in my website to run a bash script take located in a different folder to where i call the script. My script is located in

~/var/www/html/scripts/try.sh

and the page that call him is in:

~/var/www/html/pages/try.php

the try.php goes like this :

<? php
$old_path = getcwd();
chdir('../scripts/');
$output = shell_exec('./try.sh');
chdir($old_path);
?>

and try.sh is :

echo 1 > working.txt

for both of them i gave chmod 755 any idea why it's not working ? i have tried couple of ways in the php and no success please help me :( Thank you very much for getting here