× NETGEAR will be terminating ReadyCLOUD service by July 1st, 2023. For more details click here.
Orbi WiFi 7 RBE973
Reply

Installing PHP5 on Readynas Duo v2 (should work on all ARM)

kraeks
Aspirant

Installing PHP5 on Readynas Duo v2 (should work on all ARM)

Since i'm not a big fan for paying for things that are easily done by myself, I thought
i'd take the time to write down how i went about to install and configure PHP5, MySQL and phpMyAdmin
on the ReadyNAS Duo v2. (pun partially intended, although readynasxtras provide a whole set of other
packages as opt in the payed add-on...)

This assumes you've already got EnableRootAccess up and running.

1. Installing and configuring PHP5.

First off, we need to install the PHP5-package with apt-get. Log in to your NAS via SSH to get started.
As the security aware users we are (;-)) the root account is ofc disabled for login, so we'll have to
do these operations as sudoers instead. Type:

sudo apt-get install libapache2-mod-php5 php5-cli php5-common php5-cgi


Some of the packages will probably be marked as installed or set to manually. This is natural so just
type Y and sit back while the packages is being installed.

After this we have to add the php5_module and trigger php-files to be handled by the php5-module.
Type:

sudo /etc/frontview/apache2/httpd.conf


Then find the lines loading modules, for ex. :

LoadModule perl_module /usr/lib/apache2/modules/mod_perl.so


Append these lines to this section in the file:

LoadModule php5_module /usr/lib/apache2/modules/libphp5.so
AddHandler php5-script .php


Now find this line:

DirectoryIndex redirect.html index.html index.htm


and change it to:

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


Now we need to restart apache by typing:

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


You should now be able to use PHP on your ReadyNAS!

I'm going to write an instruction for how to install and configure MySQL and phpMyAdmin as well in the
upcoming posts but since I have to leave now this will have to do for the time being.

Cheers,
Simon
Message 1 of 8

Accepted Solutions
Pafin
Aspirant

Installing PHP5 on Readynas Duo v2

For the beginners like me, you can just buy https://rnxtras.com/addons/php-5-4-readynas-5-arm
Worked perfectly well on ma RND2000 ARM 5.3.10

😄

View solution in original post

Message 8 of 8

All Replies
kraeks
Aspirant

Re: Installing PHP5 on Readynas Duo v2 (should work on all A

Now we're going to install MySQL and phpMyAdmin

2. Installing and configuring MySQL

This is a pretty straight forward process. Start by installing the package with apt-get:

sudo apt-get install mysql-server


Then proceed into the MySQL console by typing:

sudo mysql


Now create a user (or as many as you need) with this command:

CREATE USER '<username>'@'localhost' IDENTIFIED BY '<42-digit password>';


When you've created all the users you need, proceed with the following:

FLUSH PRIVILEGES;
exit


Write down your freshly created password and store it in a secure location.
For example in a file in /root. A note in your drawer isn't a very good option.

You don't have to create a database at this point since this will be very easily done from phpMyAdmin.

2. Installing and configuring phpMyAdmin

Go to your www-root and download the latest phpMyAdmin version with wget using the URL found here:
http://www.phpmyadmin.net/home_page/downloads.php


In this example we will be using tar.gz.
Extract the file using the following command:

sudo tar xvzf <filename>


Now change the name of phpMyAdmin into something a little easier to write, for example phpadm by typing the following:

sudo mv <dirname> phpadm


Now you should be able to access phpMyAdmin from your external url followed by /phpadm.
Use the username and password created in MySQL to log in.
Message 2 of 8
tomvdB
Aspirant

Re: Installing PHP5 on Readynas Duo v2 (should work on all A

hello,

when i try to download/install MySQL and use

sudo apt-get install mysql

i get this response:

Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package mysql

what could i be doing wrong?

Please help, i would really like to use MySQL.

kind regards,

Tom
Message 3 of 8
kraeks
Aspirant

Re: Installing PHP5 on Readynas Duo v2 (should work on all A

Sorry. I'll update the guide. The package name is mysql-server, not just mysql. 🙂
Message 4 of 8
iearmand
Aspirant

Re: Installing PHP5 on Readynas Duo v2 (should work on all A

Can I ask a complete newbie question..but when you say "Go to your www-root and download the latest phpMyAdmin"
What do you mean by www-root...I cant find this anywhere and setting up a http service does not seem to help matters.

Also you may wish to correct the line of code below from:

sudo apt-get install mysq-serverl


to

sudo apt-get install mysql-server
Message 5 of 8
iearmand
Aspirant

Re: Installing PHP5 on Readynas Duo v2 (should work on all A

This post helped greatly with getting everything installed and working.

viewtopic.php?f=11&t=63434
Message 6 of 8
Pafin
Aspirant

Re: Installing PHP5 on Readynas Duo v2 (should work on all A

Hey,
I have a ReadyNAS Duo v2 (Série: 2UM221E700702) with firmware RAIDiator 5.3.10..
Would this work on this config?
I'm totally newbie, I'm 17'000 km far from my readynas which I can access with the Remote. How can I access the root and where should I type these commands?
Thanks

Updated : I've installed Enable root SSH access. But still, I don't know what to do next...

Updated number 2 : Downloaded APT_1.0 from http://kb.netgear.com/app/answers/detail/a_id/12272, but I get the message : "Invalid update image" when I try to install the APT utility add-on.
Message 7 of 8
Pafin
Aspirant

Installing PHP5 on Readynas Duo v2

For the beginners like me, you can just buy https://rnxtras.com/addons/php-5-4-readynas-5-arm
Worked perfectly well on ma RND2000 ARM 5.3.10

😄

Message 8 of 8
Top Contributors
Discussion stats
  • 7 replies
  • 11502 views
  • 0 kudos
  • 4 in conversation
Announcements