• Introducing WebPros Cloud - a fully managed infrastructure platform purpose-built to simplify the deployment of WebPros products !  WebPros Cloud enables you to easily deliver WebPros solutions — without the complexity of managing the infrastructure.
    Join the pilot program today!
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.

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