R PHP Online

— Online PHP CGI Web Interface for R program

by Steve Chen  in Department of Statistics, TKU, Taipei, Taiwan

R_PHP_Online is a PHP CGI web interface to run R program online, including graphic output.

R_PHP_Online is released under GPL license and can be used in both Unix and Windows OS.

R_PHP_Online is NOT a PHP extension. This means R_PHP_Online does NOT call R codes directly via library inside PHP. R_PHP_Online is purely a CGI Web interface for R, which deligate your R program to R package and show the output online.


  • 2003/06/13 Security fix

    Thanks to Dr Paul Murrell in New Zealand to remind me of security consideration.

    I am releasing version 0.2 with security fix. This version will allow

    you to add banned R function names in a list.

    • Developing Project: Net-Stat:

      You can check out a more complicated project
      on Net-Stat in Dept. of Statistics, TKU, which will be released under GPL as soon as modulization codes are completed.

  • Download R_PHP_Online:

    Current version is 0.3 with Security Fix

  • Installation:
    1. You need to have a WWW server with PHP enabled
    2. To show graphics, your UNIX system must have ghostscript installed


  • Uncompress the whole file under some directory in your web page
  • Create a sub-directory “tmp” on that directory with web writable permissions
  • Modify the first few lines in doR.php according to your setup.
  • Modify security.php for not-permitted R functions (security check).(New!)
  • Set up a cron job to clear junks in tmp directory. For example,
    # check every 10 minutes to delete *.jpg files for more than 10 min old
    */10 * * * * /usr/bin/find /www/myWeb/R_PHP/tmp -name '*.jpg' -cmin +10 -exec rm '{}' ';'  >/dev/null 2>&1