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

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