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

Scheduled Tasks - PHP script doesn't work

Webbenny

Basic Pleskian
Hello,

I have created a scheduled task, that should run a php script from my httpdocs directory. When I run the script in the same menu where I created it, it works perfect. No errors. If I run the same script from the list of scheduled tasks, it doesn't work. The same if it runs automatically at the scheduled time.

I got the following error:
Code:
-: /opt/plesk/php/5.4/bin/php: No such file or directory

Any idea what's wrong here?
 
Hi Webbenny,

please be aware, that the standard setting for a domain - specific webuser is the execution in a chrooted environment. If this user isn't allowed to execute scripts outside the chroot, then you will notice issues as described.

To check if the defined user for that crontab is allowed to run scripts, consider to check the settings:

grep 'username' /etc/passwd

To change the settings for a specific user, please use the Plesk Control Panel and define the desired access for the user ( "Web Hosting Access" ).
 
That's interesting... I was under the impression that the "Run a PHP script" option was created to avoid chrooted shell issues... especially when it gives you the option to select which PHP version to use. Why should Plesk say "hey go ahead and select from 3 version of PHP that are installed" but then fail to execute the binaries?

It seems counter-intuitive. Screenshot to illustrate.
 

Attachments

  • run a php script.png
    run a php script.png
    15.8 KB · Views: 3
Back
Top