Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents
outlinh1. true
outlinh1. true
1printablefalse
2stylh1. none
3indent20px

Suppose you have a PHP script with the following contents (simple example for Unix here):

Code Block
languagephp

 <?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.

    Image Modified 

     

    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>

...

see also:

...

 

...