PHP 5.3.X -anyone?

Post your questions about Web Server usage and Apache + PHP + MySQL/SQLite web applications.

Re: PHP 5.3.X -anyone?

Postby father_mande » Mon May 09, 2011 3:05 pm

Hi,

If you want to test or run PHP 5.3 on Qnap ...
you can try thru the Debian6 Stable Squeeze Chroot env. available as QPKG
viewforum.php?f=230

then do it manually as describe in documentation OR use the DPKG
DPKG is like QPKG but for server running inside the chroot debian6 environment.

DPKG : viewtopic.php?f=230&t=44504

version are : CONSIDERED AS STABLE BY DEBIAN
Apache version : 2.2.16
PHP version 5.3.3-7


IN ALL CASE you can easely going back to the apache / php provide by Qnap
/share/Web or /share/Qweb as the same use by Qnap ... so nothing to change ... just do the test ...
in some case ... you must change Path referring to external ressources (like imagemagick or ffmpeg ...)

Philippe.
NB. it's BETA ... but without real risk due to the jail env.
QNAP TS-459, 3.8.3 ,QPKG Debian6, Ajaxplorer 4
QNAP TS-109, under Debian Wheezy
QNAP TS-219P II, 3.8.3
QNAP TS-269L, 3.8.3 QPKG HDStation
******* VIRTUALBOX QPKG is dead ... R.I.P. *********
..... VENEZ nous rejoindre, les Francophones : http://forum.qnapclub.fr/index.php
User avatar
father_mande
Experience counts
 
Posts: 1867
Joined: Mon Oct 06, 2008 6:52 pm
Location: Saint Mande, France
NAS Model: TS-x69L

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Mon May 09, 2011 6:13 pm

thx for your help, but I already brought it back to the store. Now I'm looking for a Netgear of Synology.
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Wed May 11, 2011 4:08 pm

father_mande wrote:Hi,

If you want to test or run PHP 5.3 on Qnap ...
you can try thru the Debian..................


I had install apache2-1.1.dpkg.zip and reboot the device, but I saw no different.
There was no different PHP install ( find / -name php )

Dennis
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby father_mande » Wed May 11, 2011 9:07 pm

Hi,
Dennisonline wrote:
father_mande wrote:Hi,

If you want to test or run PHP 5.3 on Qnap ...
you can try thru the Debian..................


I had install apache2-1.1.dpkg.zip and reboot the device, but I saw no different.
There was no different PHP install ( find / -name php )

Dennis


Please read carefully the documentation provide with the Debian6 QPKG ... a long chapter are using apache2 / PHP in the chroot.

the way is :
install Debian QPKG
verify that all is mounted
mount command or better do dmgr status normally PATH now have a added /bin_deb at end ... if you don't unlogg relogg you have to exit and relogg or add it at end of Path (after it's done in /etc/profile)
export PATH=$PATH:/bin_deb

install the DPKG containing apache + php + basic php ext. like php-mysql

So Now you have (when started no reboot are needed) a new apache repplacing the actual one
the diff is easy do a ps -eaf new name for apache is apache2

to see the new version ... don't search in the Qnap structure but only in the debian chroot one ...

to enter in the chroot do : dsh

so now you can look at the diff
do php -v (for ex.)
php is uner /usr/bin AS A STANDARD Debian squeeze env.
inside the chroot refer to the Debian and apache php standard manual ...
config for php are under /etc/php5
config for apache2 are under /etc/apache2
to add php modules ... do the apt-get (tools to install in Debian ...)
list of available modules :
apt-cache search php5 | grep ^php5
to install one :
apt-get install php5-module_name as listed ...
It's better to restart apache2 so INSIDE the chroot do :
/etc/init.d/apache2 restart

and as usaul create a small php to test and list php modules.
Code: Select all
<?php
phpinfo();
?>


idem for apache ... mods are managed via mods-enabled mods-available
and site via sites-available sites-enabled ... read the standard Apache2 doc.
and tools like : a2dismod a2dissite a2enmod a2ensite

the root folder (decided by me is /share/Web (or Qweb it's a link) but you can create your own structure as well ) ...
Philippe.
QNAP TS-459, 3.8.3 ,QPKG Debian6, Ajaxplorer 4
QNAP TS-109, under Debian Wheezy
QNAP TS-219P II, 3.8.3
QNAP TS-269L, 3.8.3 QPKG HDStation
******* VIRTUALBOX QPKG is dead ... R.I.P. *********
..... VENEZ nous rejoindre, les Francophones : http://forum.qnapclub.fr/index.php
User avatar
father_mande
Experience counts
 
Posts: 1867
Joined: Mon Oct 06, 2008 6:52 pm
Location: Saint Mande, France
NAS Model: TS-x69L

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Fri May 13, 2011 12:50 am

father_mande wrote:
..........the root folder (decided by me is /share/Web (or Qweb it's a link) but you can create your own structure as well ) ...
Philippe.


Thx Philippe,

I had read already viewtopic.php?f=230&t=44504 but I can't found if functions like the copy button still working? Or must I flash the QNAP and is the QNAP webinterface (change/add users) also gone. Can I see it as a fresh install of Debian?

Or do I have to install Webmin discribed Webmin_Installation_On_Debian_QNAP

Dennis
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby father_mande » Fri May 13, 2011 3:33 pm

Hi,
Dennisonline wrote:
I had read already viewtopic.php?f=230&t=44504 but I can't found if functions like the copy button still working? Or must I flash the QNAP and is the QNAP webinterface (change/add users) also gone. Can I see it as a fresh install of Debian?

Or do I have to install Webmin discribed Webmin_Installation_On_Debian_QNAP

Dennis


The major avantage of a chroot (the one install by the QPKG) is that YOU DON'T stop, modify, change ANY things inside the QNAP original firmware ...
So : copy button is active
administration is active ...
all stay the same and run without any change ...

A chroot (I don't know if you know the concept) is a folder with a different version of the Linux structur ... , before you enter in the chroot (jail) using the chroot command ... it's only a folder with data unknow by Qnap Linux application ...
when you enter the chroot command "chroot folder_where_new_linux_is" :
... you have a new " / " folder BUT with the same kernel ... so now, all is relative to the folder use in chroot command ...
for ex. /etc is not the /etc of the Qnap but is now the one relative to the folder use in chroot command.

IT'S A JAIL ... this method can be use in different usages :
... for ex. in openssh to hide the "real system" for user connected
... for ex. to test new librairie or version without changing the lib of the real system
... for running specific application (use in the past (TS-x09 series) by Qnap to run Ipkg server) and some integrated server but requiring different librairies ...

To be able to run the chroot use :
the installed kernel (and if kernel module are required ...) this module must be compiled for the kernel ... not and nor for the chroot env.
some system mount ...
... so a special mount option exist ( bind ) to be able to mount some device or folder to another mount point (it's a pointer ... so contents are the same ... ( only in some very specific case access right can be change))
the minimum are for the chroot to mount /dev /dev/pts and /proc with this you can run program in the chroot ...

In my QPKG I add the possibilty to mount some others folder to share data between the chroot and the real qnap system
/share/Web for ex.

The very important point is to understand that IF YOU RUN a server INSIDE the chroot ... the server ONLY know the chroot env. even if you see it as a "normal" executable program in the Qnap ... it's the bigest source of misunderstanding ... if your server call another program for ex. /bin/xxxx ; the xxxx is search in the /bin of the chroot NOT in the /bin of the system ...

SO BEFORE YOU START SOMETHINGS INSIDE THE CHROOT ... nothing run in the Qnap and absolutly NO CHANGE to ALL Qnap services ...

for testing apache2 and new Php in chroot you need (if you want to keep the same TCPIP port)
stop apache in the Qnap env.
stop the Qthhtpd started by Qnap when you stop apache in the Qnap env.
suppress a cron job that restart Qthhtpd each night.
THEN
enter in the chroot : chroot folder_of_the_chroot (done by dsh command provide with QPKG)
and INSIDE the chroot configure and run the new apache2 and php server ...

for an external point of vue ... the apache2 seems to run as a "normal" Qnap services ...
BUT REMEMBER ALL others Qnap services still available ... Webadmin, filemanager, download station ... etc.
ONLY appalication using the QNAP apache can be impacted ...
MSV2 and plugmedia stop running because they call cgi-bin in the non chroot env.. (impossible when you are in the Jail (chroot) )
some applications required a small change (for ex. Gallery want to know the Path to imagemagick ... and it's NOT the same in Qnap Linux and in Debian Linux ...
Lot of others can be run as is in the new server ...

Webmin is absolutly not required to manage the system (use the Webadmin ... as usual), but it's true that you can use it in the chroot for some specific (not Qnap related) usage ... like managing Apache ...

Sorry to be soo long ... BUT CONCEPT are the first step to start with chroot .

Philippe.
QNAP TS-459, 3.8.3 ,QPKG Debian6, Ajaxplorer 4
QNAP TS-109, under Debian Wheezy
QNAP TS-219P II, 3.8.3
QNAP TS-269L, 3.8.3 QPKG HDStation
******* VIRTUALBOX QPKG is dead ... R.I.P. *********
..... VENEZ nous rejoindre, les Francophones : http://forum.qnapclub.fr/index.php
User avatar
father_mande
Experience counts
 
Posts: 1867
Joined: Mon Oct 06, 2008 6:52 pm
Location: Saint Mande, France
NAS Model: TS-x69L

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Fri May 13, 2011 4:06 pm

Ok,thx for explain that it's not too long!! I used translate on google what chroot means, but now I know that.

It's sound really good and clear. When I have my TS-119P+ back I'll first chroot my QNAP and let you know.

Thx,
Dennis
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby Moogle Stiltzkin » Fri May 13, 2011 4:56 pm

Thx father_mande for the explanation.

Makes it easier nubs like me to know it works :mrgreen:
NAS
[Main Server] QNAP TS-659 Pro w. 4x 2TB Samsung EcoGreen F3 (HD203WI) EXT4 Raid5
[Backup] QNAP TS-509 Pro w. 5x 1TB Western Digital RE3 (WD1002FBYS) EXT4 Raid5

Other Devices
ESR-9850 Router | 10mbps download/upload FTTH Internet Connection | Windows 7 Ultimate Water Cooled PC with Intel i7 920 c0/c1 |


Desktop hard drives recommended for raid

How to setup Plex Media Server with QNAP
User avatar
Moogle Stiltzkin
Experience counts
 
Posts: 1177
Joined: Thu Dec 04, 2008 12:21 am
Location: Malaysia
NAS Model: TS-659 Pro II

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Mon May 16, 2011 11:51 pm

Philippe,

I'll use the TS-119P+ for calendar sync also.
I'll sync Outlook (2003/2007) and my iPhone' calendar with the TS-119P+.

I found a view package on http://wiki.debian.org/Groupware/ and want to use egroupware or do you think I should use Citadel
And sync with Outlook Open-Source Outlook Connector

Thx,
Dennis
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Tue May 17, 2011 9:42 pm

[edit 19:41 17-05-2011]
it;s not so easy: apt-get install php5-curl and now the curl issue is fixed.....
[/edit]
Last edited by Dennisonline on Wed May 18, 2011 6:41 am, edited 1 time in total.
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Wed May 18, 2011 2:43 am

Next issue

I'll run from the Cronjob.
I can edit /mnt/HDA_ROOT/.conf/crontab
and have add * * * * * * /usr/bin/php /share/HDA_DATA/Web/script.php
than
crontab /etc/config/crontab
/etc/init.d/crond.sh restart
crontab -l

But I think only when you used the command dsh /usr/bin/php will work??


Or must I use a different crontab?

I have add this * * * * * dsh /usr/bin/php /share/HDA_DATA/Web/script.php or is that wrong, it seems to work.
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby father_mande » Wed May 18, 2011 4:26 pm

Hi,
Dennisonline wrote:Next issue

I'll run from the Cronjob.
I can edit /mnt/HDA_ROOT/.conf/crontab
and have add * * * * * * /usr/bin/php /share/HDA_DATA/Web/script.php
than
crontab /etc/config/crontab
/etc/init.d/crond.sh restart
crontab -l

But I think only when you used the command dsh /usr/bin/php will work??


Or must I use a different crontab?

I have add this * * * * * dsh /usr/bin/php /share/HDA_DATA/Web/script.php or is that wrong, it seems to work.


The MANDATORY rules to execute any application inside the chroot is to ENTER in the chroot then execute

dsh is equal to the command : chroot folder_root_of_the_chroot (this Path is fullfilled automaticly by dsh) then execute the command associated or start a besh (inside the chroot)

So your command seems correct ... but not the crontab line ... it's must be :
* * * * * * dsh /usr/bin/php /share/HDA_DATA/Web/script.php
or better use as usual full path name /bin_deb/dsh

this command execute /usr/bin/php inside the chroot (due to the call thru dsh) with your script as parameters ...

it's general rules ... I don't knwo what exactly you want to do ...
Philippe.
QNAP TS-459, 3.8.3 ,QPKG Debian6, Ajaxplorer 4
QNAP TS-109, under Debian Wheezy
QNAP TS-219P II, 3.8.3
QNAP TS-269L, 3.8.3 QPKG HDStation
******* VIRTUALBOX QPKG is dead ... R.I.P. *********
..... VENEZ nous rejoindre, les Francophones : http://forum.qnapclub.fr/index.php
User avatar
father_mande
Experience counts
 
Posts: 1867
Joined: Mon Oct 06, 2008 6:52 pm
Location: Saint Mande, France
NAS Model: TS-x69L

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Wed May 18, 2011 4:47 pm

What I'm want to do, I have a view PHP scripts that RSS-feed reads and post on a website. (perhaps I can use PHP-CLI??)
It's now running on a Windows machine and want to use the QNAP for that.

I found this about cronjobhttp://en.wikipedia.org/wiki/Cron
* * * * * command to be executed
- - - - -
| | | | |
| | | | |
| | | | +----- day of week (0 - 7) (Sunday=0 or 7)
| | | +---------- month (1 - 12)
| | +--------------- day of month (1 - 31)
| +-------------------- hour (0 - 23)
+------------------------- min (0 - 59)
http://en.wikipedia.org/wiki/Cron

So I don't understand your 6 * ...
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

Re: PHP 5.3.X -anyone?

Postby father_mande » Wed May 18, 2011 4:55 pm

Hi,
Dennisonline wrote:What I'm want to do, I have a view PHP scripts that RSS-feed reads and post on a website. (perhaps I can use PHP-CLI??)
It's now running on a Windows machine and want to use the QNAP for that.

So I don't understand your 6 * ...


It's only a cut and paste of your own line in the post .... I don't rewrite I do a copy (so your 6 * rest ...) and add dsh ... so no matter ...
Dennisonline wrote:I can edit /mnt/HDA_ROOT/.conf/crontab
and have add * * * * * * /usr/bin/php /share/HDA_DATA/Web/script.php
than


:lol: :lol:

Philippe.
QNAP TS-459, 3.8.3 ,QPKG Debian6, Ajaxplorer 4
QNAP TS-109, under Debian Wheezy
QNAP TS-219P II, 3.8.3
QNAP TS-269L, 3.8.3 QPKG HDStation
******* VIRTUALBOX QPKG is dead ... R.I.P. *********
..... VENEZ nous rejoindre, les Francophones : http://forum.qnapclub.fr/index.php
User avatar
father_mande
Experience counts
 
Posts: 1867
Joined: Mon Oct 06, 2008 6:52 pm
Location: Saint Mande, France
NAS Model: TS-x69L

Re: PHP 5.3.X -anyone?

Postby Dennisonline » Wed May 18, 2011 5:29 pm

Ok I see :oops:
Do you know something about the calendar?


And about the cron job.
After a reboot the cron job not working (I see no script output), but the procces (ps) is running: 1894 admin 748 S /usr/sbin/crond -l 9 -c /tmp/cron/crontabs
If I restart the cron job service /etc/init.d/crond.sh restart it works fine, hows that possible?
Solution: * * * * * /share/HDA_DATA/.qpkg/debian6/bin_deb/dsh /usr/bin/php -q /share/HDA_DATA/Web/script.php > /dev/null
Dennisonline
Starting out
 
Posts: 35
Joined: Thu Apr 28, 2011 7:15 pm
NAS Model: TS-109/209 Pro II

PreviousNext

Return to Web Server & Applications (Apache + PHP + MySQL / SQLite)

Who is online

Users browsing this forum: No registered users and 3 guests