Setting up a PHP CGI Environment

March 24, 2008 by yoh-dah  
Filed under How-To's

Requirements

  1. RAIDiator-4.00c1-p2 or later for non-x86.
  2. APT utility addon for non-x86 (x86 platform has APT built-in). Download and install it using the Frontview web UI under System -> Update -> Local Update.
  3. EnableRootSSH or EnableRootSSH (x86) add-on. Again, install using the Frontview web UI under System -> Update -> Local Update. This will allow you to SSH in to the ReadyNAS and bring up a shell command prompt.

Installation

Once you login as root, you’ll need to use apt-get to install the PHP package and restart Apache.

 # apt-get update
 # apt-get install libapache2-mod-php5

If you are running RAIDiator 4.01c1-p1 or earlier, you’ll need to modify the Apache configuration file to recognize index.php as an index file.  To do this, you’ll need to modify one line in /etc/frontview/apache/httpd.conf as follows (you can use the built-in text editor vi or copy and modify this file on your PC or Mac, and copy back to the ReadyNAS):

Search for the line:

DirectoryIndex redirect.html index.html index.htm

and append index.php to it as follows:

DirectoryIndex redirect.html index.html index.htm index.php

As a last step, you’ll need to restart Apache.

 # killall apache-ssl
 # apache-ssl -f /etc/frontview/apache/httpd.conf

WARNING!

Please note that you can get your ReadyNAS into peril easily by overriding some of the system libraries and utilities. Do not do your development on a system you don’t have a backup of as you may end up re-installing the firmware or worse yet, doing a factory default.

1 Star2 Stars3 Stars4 Stars5 Stars (34 votes, average: 4.00 out of 5)
Loading ... Loading ...

Comments are closed.