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

PHP & sudo

L

lhenor

Guest
I recently upgraded a server from 7.0.4 (FreeBSD) til 7.5.3 (FreeBSD). Most of of the existing data where transferred through PMM sucessfully.

However, my registration scripts are no longer working. They are simple php calls to sudo shell scripts.

What have been changed and how can I do s simple workaround for this problem.

Thanks
LheNor
 
Make sure that there is no PHP safe_mode issue. What do you get on the screen from the PHP page?
 
When i try to run a sudo script I get nothing back from the exec command. However, if I run a simple 'whoami' command I get return..

PHP safe_mode is off. I guess I should switch safemode on, but I have not touched the config for this domain since v.7.1.x

Any ideas? - I am stuck here...
 
If safe_mode is off is ok. The problem is in the script, not in PHP. Are you sure that apache has permissions to execute the script? Have you checked the server error_log?
 
I have simple test script which tries to exceute the domain creation utility.
For testing purposes I have granted everyone sudo rights.
I am using full paths to execute the scripts.

Exactly the same scripts worked at the old server.

Example;

php: shell_exec("./domainCreate.sh");

script;

#!/bin/sh
sudo-u root /usr/local/psa/bin/domain.sh $*
#echo $* >> /usr/autosys/psa/domains/data
 
After some futher test it seems that it is the domain creation utility that is working..

I created a root runnable script and sucessfully ran the script from php using sudo command.. whoami also show root..

How can I workaround this issue?
The client have access to php...
 
Back
Top