JoliNotif
JoliNotif copied to clipboard
shell_exec not working
I am trying to use your code (JoliNotif). When I run directly in CMD works fine, but if I try run in shell_exec not working.
Error message:
Fatal error: Uncaught Symfony\Component\Process\Exception\ProcessTimedOutException: The process ""F:\wamp64\www\JoliNotif\vendor\jolicode\jolinotif/bin/snoreToast/snoretoast-x86.exe" -m "This is the body of your notification" -t "Notification title"" exceeded the timeout of 60 seconds. in F:\wamp64\www\JoliNotif\vendor\symfony\process\Process.php on line 1152
Symfony\Component\Process\Exception\ProcessTimedOutException: The process ""F:\wamp64\www\JoliNotif\vendor\jolicode\jolinotif/bin/snoreToast/snoretoast-x86.exe" -m "This is the body of your notification" -t "Notification title"" exceeded the timeout of 60 seconds. in F:\wamp64\www\JoliNotif\vendor\symfony\process\Process.php on line 1152
Call Stack:
0.0002 392504 1. {main}() F:\wamp64\www\JoliNotif\index.php:0
0.4557 840440 2. Joli\JoliNotif\Notifier\CliBasedNotifier->send($notification = class Joli\JoliNotif\Notification { private ?string $title = 'Notification title'; private ?string $body = 'This is the body of your notification'; private ?string $icon = ''; private array $options = ['subtitle' => 'This is a subtitle', 'sound' => 'Frog'] }) F:\wamp64\www\JoliNotif\index.php:21
0.4557 841960 3. Symfony\Component\Process\Process->run($callback = ???, $env = ???) F:\wamp64\www\JoliNotif\vendor\jolicode\jolinotif\src\Notifier\CliBasedNotifier.php:82
0.4641 867488 4. Symfony\Component\Process\Process->wait($callback = ???) F:\wamp64\www\JoliNotif\vendor\symfony\process\Process.php:249
60.5834 867488 5. Symfony\Component\Process\Process->checkTimeout() F:\wamp64\www\JoliNotif\vendor\symfony\process\Process.php:423
Can you help me? Whats the problem?
Thanks
So it looks like an anchor is missing in the directory?
Can you dump array_merge([$binary], $arguments) before this line https://github.com/jolicode/JoliNotif/blob/main/src/Notifier/CliBasedNotifier.php#L81C33-L81C66 ?
Thanks
F:\wamp64\www\JoliNotif\vendor\jolicode\jolinotif\src\Notifier\CliBasedNotifier.php:81:
array(5) {
[0] =>
string(83) "F:\wamp64\www\JoliNotif\vendor\jolicode\jolinotif/bin/snoreToast/snoretoast-x86.exe"
[1] =>
string(2) "-m"
[2] =>
string(37) "This is the body of your notification"
[3] =>
string(2) "-t"
[4] =>
string(18) "Notification title"
}
Hi @leofloripas, thanks for the feedback, can you give us an example of the code that you use ?
Closing for lack of feedback. Feel free to comment or reopen if you have more insights on this issue :slightly_smiling_face: