• We value your experience with Plesk during 2024
    Plesk strives to perform even better in 2025. To help us improve further, please answer a few questions about your experience with Plesk Obsidian 2024.
    Please take this short survey:

    https://pt-research.typeform.com/to/AmZvSXkx
  • The Horde webmail has been deprecated. Its complete removal is scheduled for April 2025. For details and recommended actions, see the Feature and Deprecation Plan.
  • We’re working on enhancing the Monitoring feature in Plesk, and we could really use your expertise! If you’re open to sharing your experiences with server and website monitoring or providing feedback, we’d love to have a one-hour online meeting with you.

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