Não é possível iniciar o script bash com shell_exec

Não é possível iniciar o script bash com shell_exec

Estou pesquisando no Google e tentando resolver esse problema com meu script php há alguns dias e espero que alguém aqui possa ver o problema que estou perdendo ao fazer meu script php iniciar meu script bash.

Aqui está meu php:

//kickoff the yapeal script
echo "Starting yapeal.sh<br>";
echo "Current working directory: ";
echo getcwd() . "\n";
shell_exec('./yapeal.sh');
echo "<br>yapeal.sh ran, I hope.<br>";

Aqui está o yapeal.sh

#!/bin/bash
cd /var/www/tools/applications
php -f /var/www/lib/yapeal/yapeal.php
sleep 5s
echo "`date -u` Yapeal kicked off, working" > bashoutput.log 2>&1

Aqui estão as permissões nos arquivos:

-rwxrwxrwx 1 www-data www-data 4640 Jul 10 07:20 index.php
-rwxrwxrwx 1 www-data www-data 2845 Jul 10 07:33 working.php
-rwxrwxrwx 1 www-data www-data  232 Jul 10 07:17 yapeal.sh

Aqui está o que recebo como saída no navegador da web:

Starting yapeal.sh
Current working directory: /var/www/tools/applications
yapeal.sh ran, I hope.

Não há saída para o arquivo bashoutput.log.

Verifiquei meu php.ini, não há referência a exec ou shell_exec na seção disable_functions.

Responder1

Eu resolvi meu próprio problema.

Modifiquei o código php para:

$output = shell_exec('./yapeal.sh');
echo $output;

informação relacionada