• The APS Catalog has been deprecated and removed from all Plesk Obsidian versions.
    Applications already installed from the APS Catalog will continue working. However, Plesk will no longer provide support for APS applications.
  • Please be aware: with the Plesk Obsidian 18.0.78 release, the support for the ngx_pagespeed.so module will be deprecated and removed from the sw-nginx package.

Question PLESK BIN Command Line not Working through PHP

rxb

New Pleskian
Hello,

Short story : I need PLESK BIN to be executed from a PHP file.

Long story
  1. I made a SH script to add Plesk subscription (newplesk.sh)
  2. I need this script to be started from a PHP file.
  3. It's working through SSH when typing
    Code:
    php testplesk.php
  4. It's not working when I enter the direct path into web browser (https://example.com/testplesk.php)
testplesk.php :

Code:
<?php
exec('php testshell.php');
?>

testshell.php :

Code:
<?php
shell_exec('sudo sh newplesk.sh');
?>

newplesk.sh :

Code:
plesk bin subscription --create 6.domain.tld -owner admin -service-plan "Default Domain" -ip xxx.xxx.xxx.xxx -login jdoe6 -passwd "pwd6"

All of these files are chown in xxx : psacln the .SH is chown +x , the subscription is added through putty but i would like it to work when a WEB button is clicked.

Any help please ? Best Regards.
 
Yo you review your error log? also check the open_basedir, probably you also don't have correct path/var ENV from web.
 
Back
Top