Vesta Control Panel - Forum

Community Forum

Skip to content

Advanced search
  • Quick links
    • Main site
    • Github repo
    • Google Search
  • FAQ
  • Login
  • Register
  • Board index Main Section General Discussion Debian/Ubuntu
  • Search

List all packages with exec()

Debian/Ubuntu related topics
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
ymakux
Posts: 4
Joined: Sat Oct 22, 2016 7:07 am

List all packages with exec()
  • Quote

Post by ymakux » Thu Jun 08, 2017 5:17 pm

I'm trying get a list of all available packages using PHP exec() but it returns only empty array:

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));
The same for another format type (shell, plain etc)

What's wrong?
Top

ymakux
Posts: 4
Joined: Sat Oct 22, 2016 7:07 am

Re: List all packages with exec()
  • Quote

Post by ymakux » Thu Jun 08, 2017 5:55 pm

Probably something related to permissions. Web API works fine
Top

tjebbeke
Collaborator
Posts: 783
Joined: Mon May 11, 2015 8:43 am
Contact:
Contact tjebbeke
Website

Os: CentOS 6x
Web: apache + nginx
Re: List all packages with exec()
  • Quote

Post by tjebbeke » Tue Jun 13, 2017 8:50 am

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.
Top


Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Debian/Ubuntu”



  • Board index
  • All times are UTC
  • Delete all board cookies
  • The team
Powered by phpBB® Forum Software © phpBB Limited
*Original Author: Brad Veryard
*Updated to 3.2 by MannixMD
 

 

Login  •  Register

I forgot my password