• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • 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.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

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