↑ ↓ select, Enter open, Esc close

Run a PHP script with a specific Plesk PHP version

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
user@server
/opt/plesk/php/8.3/bin/php /var/www/vhosts/example.com/httpdocs/cron.php

Calls the PHP interpreter of a specific Plesk PHP version directly via its full path. This way, cron jobs and maintenance scripts run with the same extensions and version as the website. Works the same for tools like Composer or WP-CLI, for example /opt/plesk/php/8.3/bin/php /usr/local/bin/composer install.

Note: The risk depends on the script. Run it as the subscription user, not as root.

Also searched as

  • cron job with correct php version
  • run php script with different version
  • composer with plesk php

Related one-liners

All in PHP

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.