You can either call them by specifying the interpreter to load the scripts in the crontab, with this syntax:
* * * * * /usr/php/54/usr/bin/php yourscript.php
Or, alternatively, if you are comfortable modifying the scripts, you can use a shebang line on top of it. To use the shebang line you just need to modify the first line of the script to look like this:
#!/usr/php/54/usr/bin/php
Then you need to make the script executable with chmod +x yourscript.php
and then you can directly call it without specifying the interpreter like:
* * * * * yourscript.php
Here is more documentation about the shebang line: shebang
In many cases I think probably the first way (specifying the interpreter in the crontab) would be preferred, because it doesn't require you to modify the script itself.
manpreet
Best Answer
2 years ago
My hosting company switched me to php version 5.4. I run a Drupal site (D7.) They say:
You'll want to make sure your crons use "/usr/php/54/usr/bin/php" instead, as otherwise it will use PHP 5.2.
How do I do that?
Change the php.ini file? Create a new file?
What is the exact syntax for it?