List all packages with exec()
List all packages with exec()
I'm trying get a list of all available packages using PHP exec() but it returns only empty array:
The same for another format type (shell, plain etc)
What's wrong?
Code: Select all
$cmd = '/usr/bin/sudo /usr/local/vesta/bin/v-list-user-packages json';
$return = 0;
$output = array();
exec($cmd, $output, $return);
print_r(json_decode(implode("\n", $output), true));
What's wrong?
Re: List all packages with exec()
Probably something related to permissions. Web API works fine
-
- Collaborator
- Posts: 783
- Joined: Mon May 11, 2015 8:43 am
- Contact:
- Os: CentOS 6x
- Web: apache + nginx
Re: List all packages with exec()
Wish user are you using to execute the script? Is the user maybe not allowed to execute the sudo command?
It's better to use the API for this.
It's better to use the API for this.