• 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
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

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