• Debian 11 is approaching its end-of-life (vendor EOL date - August 31, 2026). Plesk Obsidian 18.0.80 will be the last release to support it.
    If you are running Plesk Obsidian on Debian 11, we recommend you upgrade those servers to Debian 12 using our dist-upgrade tool.
  • We plan to deprecate and remove the support for XML RPC protocol versions earlier than 1.6.9.1 in Plesk Obsidian 18.0.82. We strongly recommend that you update all existing integrations using earlier versions of the XML RPC protocol to comply with the version 1.6.9.1 specification.

crontab

R

robinthecam

Guest
Hi there,

I´m a newbie on setting up cron jobs... My Problem is, i want to execute a .php script on a specified time! can someone tell me what is the syntax for my command!

Thanks in advance
r
 
1) find where your php interpreter resides

$ which php
/usr/local/bin/php

2) Add the following line to begin of you php script:

#!/usr/local/bin/php -q

3) make you php script executable

$chmod 755 /path/to/your/script.php

4) Make sure you script works properly by trying to start it from the command line

$ /path/to/your/script.php

<script output here>

5) add command line to your crontab

$ crontab -e

For example, to start script every day at 5:00:

0 5 * * * /path/to/your/script.php
 
duh ?

Hey guys,

Isn't this supposed to be the Windoze thread???

Or am i missing something?
 
Thanks defencer,

Can you tell me what this does:

Originally posted by defencer
#!/usr/local/bin/php -q

Also...

when i access this file from http it works fine, but from shell i get these errors.

/home/httpd/vhosts/site/httpdocs/ts/page.php: ?: No such file or directory
/home/httpd/vhosts/site/httpdocs/ts/page.php: line 3: syntax error near unexpected token `set_time_limit(0)'
/home/httpd/vhosts/site/httpdocs/ts/page.php: line 3: `set_time_limit(0);'

Thanks!
 
ahh i think it was because i added the code inside the <?


#!/usr/local/bin/php -q
<?
echo "hello";
?>

works!

i am getting this error in my actual file which works great through http, but not thorough shell.

Fatal error: Call to undefined function: iconv() in /home/httpd/vhosts/site/httpdocs/tb/file.php on line 237

$xml = iconv("ISO-8859-1", "UTF-8",$xml);
 
Are you running windows or linux? It makes a difference. This is a Windows forum and it looks like you are talking about Linux
 
<Gack> yeah the previous post seemed relevant. maybe a moderator can cut this thread to plesk 6.0?
 
Back
Top