• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Please beaware of a breaking change in the REST API on the next Plesk release (18.0.62).
    Starting from Plesk Obsidian 18.0.62, requests to REST API containing the Content-Type header with a media-type directive other than “application/json” will result in the HTTP “415 Unsupported Media Type” client error response code. Read more here

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