[updated again!] stop changing my question it became unprecise.
I have kdeconnect 1.4.0 installed on Ubuntu 20.04.2 LTS Focal and it is functional. I am able to text from the command line using the user that I used installed kdeconnect with.
My current task is to have the command "kdeconnect-cli" executable by Apache2 version 2.4.41 with PHP version 7.4.
I thought it would be as simple as adding the path to the command to the PHP.INI, but that does nothing.
Apache2 runs as the user www-data and I have made these changes to grant the privilege and run the command. But it still does not work.
- I used
shell_execand it returns blank. I have tested this and get no output
$command = "kdeconnect-cli --send-sms $message --destination $phoneNumber --device 26de31sdfbc6b97f";
$output = shell_exec($command);
- I added the command to the /etc/php/7.4/cli/php.ini file
include_path = ".:/usr/bin"
- I added this line to the sudoers file
www-data ALL=(KDEUSER) NOPASSWD: /usr/bin/kdeconnect_cli
- I've tried making a .sh file that run the kdeconnect-cli and it works in the terminal, but it does not if run by 'www-data' in PHP
My ultimate goal is to run kdeconnect-cli with PHP, what am I missing?
Thanks in advance.
P.S. Don't edit my question.