Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Suppose you have a PHP script with the following contents (simple example for Unix here):
Code Block | ||
---|---|---|
| ||
<?php
phpinfo();
?>
|
To enable the Job Scheduler JobScheduler to execute this script directly, we need you have to make only two changes to the script.
First, add one line to the top of the script:
Code Block
...
#!/usr/bin/php
...
<?php phpinfo(); ?>
Note that the first line is an interpreter directive, which tells the operating system which program to load.
Secondly, make this file executable with:
chmod u+x info.php
You also can add the script directly to the job definition instead of using a separate file.
Code Block
...
<?xml version="1.0" encoding="ISO-8859-1"?>
...
<job name="job_execphp"> <script language="shell"> <![CDATA[ #!/usr/bin/php <?php phpinfo(); ?> ]]> </script> <run_time/> </job>
...