General NAS-Central Forums

Welcome to the NAS community
It is currently Sat Apr 29, 2017 3:32 pm

All times are UTC




Post new topic Reply to topic  [ 15 posts ] 
Author Message
 Post subject: update PHP version
PostPosted: Sat Mar 28, 2015 11:56 pm 
Offline

Joined: Sat Mar 28, 2015 11:48 pm
Posts: 1
Hi to all,
I'm trying to install OwnCloud on my Network Space 2 but the last versione require php 5.4.0 but on the nas php version is 5.3.4.
Can you help me to update the PHP version if it's possible?
Thank you very much.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Mon Apr 06, 2015 8:01 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
hey,
Haven't tried updating the firmware php used with lighttpd, but i compiled apache 2.2.29 with php 5.4.39 and 5.6.7 just to try pydio or owncloud running.
After fighting with compiling lists of dependencies the performance of both (owncloud and pydio) was awful. they were useable but it means nothing else can run simultaneously with them (i use my NS2 to watch movies) if a file sync or browsing pydio/owncloud pages while watching, everything goes slow, cpu is 100% for long enough to force me stop watching and just go to sleep.plus you should forget about transmission as it needs some resources, unless you are thinking of very light usage.

you can either compile on NS2 itself (php takes about 2 hours) or build a cross-compile with crosstool-ng (better option)


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Mon Apr 06, 2015 9:11 pm 
Offline

Joined: Wed Mar 18, 2009 11:13 pm
Posts: 771
you must have done something wrong

our firmware (fvdw-sl see plugout.net) uses apache, php and works well with transmission and own cloud. of course you cannot compare performance with a pentium quad core with 4 GB RAM but it is not as bad as you suggest.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Tue Apr 07, 2015 2:45 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
nothing wrong, it all depends on your usage and performance evaluation. but i hade both apache and lighttpd running.

Today i compiled php-5.4.39 and attached it for lighttpd. Haven't compiled any extensions yet, once done will install owncloud and update you.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Thu Apr 09, 2015 7:03 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
Here is php-5.4.39 "prefix=/opt/php-5.4.39" with most needed extensions static, you can install more extension via pecl. I used optware packages, and compiled vpx, libmcrypt, mcrypt & mhash. I guess i will have to tar them as well for others.

This time when i tried to install OwnCloud i ran into and error:Setting locale to en_US.UTF-8/fr_FR.UTF-8/es_ES.UTF-8/de_DE.UTF-8/ru_RU.UTF-8/pt_BR.UTF-8/it_IT.UTF-8/ja_JP.UTF-8/zh_CN.UTF-8 failed

I assume NS2 doesn't have locales installed, but don't know what will happen if we force skip owncloud locale check.

If someone knows a workaround would appreciate it.

NB.: Please add to a repo, i can not guarantee how long to keep.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Thu Apr 09, 2015 8:51 pm 
Offline

Joined: Wed Mar 18, 2009 11:13 pm
Posts: 771
seems you are making progress.
Using this setup will probably cause dependency issue which you partly avoided by compiling extensions static. This will increase cpu and RAM usage when these are used. Furthermore optware packages are not very reliable I found out in the past.

I don't know what the lacie firmware has on board as locales , you could try to install those as well. Be are that when you install lacie upgrades that probably you need to repeat all the setup you made.

Also bear in mind that your combination of webserver and pphp 5.4.7 will not support large file (> 2GB) for that you need use the latest php like 5.5.7 (and use the right ldflags for large file support)


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Fri Apr 10, 2015 10:48 am 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
Quote:
This will increase cpu and RAM usage when these are used. Furthermore optware packages are not very reliable I found out in the past.

I've tested with dynamic php extensions before, CPU and MEM usage is almost the same. I used optware packages to do less compiling, didn't have issues with it so far, hope will not :roll: or will have to compile a lot more.

Quote:
I don't know what the lacie firmware has on board as locales , you could try to install those as well.

I had earlier version of owncloud installed, i don't remember having an issue with locale before, this time OwnCloud8 is requesting locales. What should i compile/Install to satisfy that?

Quote:
Be are that when you install lacie upgrades that probably you need to repeat all the setup you made.

php installation is on "opt", and i just change /etc/lighttpd.conf to use the new php, when i upgrade i can just pull things back with no need to recompile.

Quote:
Also bear in mind that your combination of webserver and pphp 5.4.7 will not support large file (> 2GB) for that you need use the latest php like 5.5.7 (and use the right ldflags for large file support)

Would you mind to explain this more, why lighttpd with php-5.4.39 can handle files larger than 2 GB ?
Haven't noticed that before, I tested with Ajaxplorer and it cannot open directories with files bigger than 2GB, but original php-3.4 works using same php.ini, what is the reason here?

EDIT:
I investigated the locale issue with Owncloud, files will be lost if they contain an unsupported character, hence i just bypassed that check.

@fvdw: Remaining issue now is (files bigger than 2GB), which doesn't exist with the firmware php-5.3.4, currently i am compiling php-5.6.7 if that will resolve the issue. If you know a better workaround i would like to keep 5.4.39 because i have another webapp which would fail to run on php-5.6.7. but if this will be the only solution i can sacrifice that.
update: recompiling with "-D_FILE_OFFSET_BITS=64" hope that fixes it :|

@andreabo: If anything fails with you for any dependency, kindly inform me to provide them to you.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Fri Apr 10, 2015 8:24 pm 
Offline

Joined: Wed Mar 18, 2009 11:13 pm
Posts: 771
I compiled 5.4 version with the flags for large file but they didn't work, they compiled and became larger but could not handle files > 2GB. They will start when up or downloading but fail to complte
Only 5.6.x versions seems to be able to use large files (when compiled with he correct flags)

ps this were the flags I added in the configure command for php
Code:
CFLAGS="-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64"


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Fri Apr 10, 2015 9:45 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
@fvdw: Thank you for pointing out the file limit issue, didn't know about it earlier.

Performance with lighttpd is a bit better than when i had both lighttpd + Apache. CPU still spiking at 100% & memory is 50% which is way better. Other services are running ok while syncing, but syncing is slower than how it was with apache (i guess).


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Sat Apr 11, 2015 9:23 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
WOW, php-5.6.7 on NS2 is a boost with opcache enabled :geek:

Performance is way better after enabling opcache, things are different now, I will really use it , thanks for inspiring me to give it another shot :D

thanks for highlighting the php file size limit, although i compiled php several times but never noticed that :o


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Mon Apr 20, 2015 11:28 am 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
@admins: request upload space to share the below files:
php-5.6.7_arm.ipk
libvpx-1.3.0_arm.ipk
libmcrypt-2.5.8_arm.ipk
mcrypt-2.6.8_arm.ipk
libssh2-1.4.3_arm.ipk
mhash-0.9.9.9_arm.ipk


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Mon Apr 20, 2015 8:00 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5981
viewtopic.php?f=66&t=501


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Sat Apr 25, 2015 7:57 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
When attempting to create an account, getting this error:

APPLICATION ERROR #2701
Session variable "captcha_key" not found.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Sun Apr 26, 2015 12:27 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 5981
Please retry.


Top
 Profile  
 
 Post subject: Re: update PHP version
PostPosted: Mon Apr 27, 2015 1:07 pm 
Offline

Joined: Sat Feb 05, 2011 8:46 pm
Posts: 19
Instructions on updating php.

NB.
1- Updating php version to a higher version on default running lighttpd will cause default file browser to break (I assume that's why Lacie kept that old version)
2- Opcache will consume respectful amount of memory on the device, you can disable it and test which is better for you (Opcache or memory), I preferred OpCache
3- This provided php version is without Apache php module.
4- I assume you have ipkg installed, if not check: Setup Optware on a NS2
5- Beware of sda9 free space, required space ~220MB (if you have /opt mounted and you are intending to use this php version with default lighttpd, you will have to be sure that lighttpd service loads after your mounting)
6- Of course you are doing that at your own risk :)

* For point nr#1, I have replaced default Ajaxplorer with version 4..2.3 (Higher version are with bad performance on NS2).

Instructions:
Code:
ipkg install openssl libcurl perl zlib libxml2 bzip2 libpng libjpeg xpm xproto freetype fontconfig
ipkg install http://downloads.lacie.nas-central.org/Users/minosh/NetworkSpace2/ipkg_packages/libvpx-1.3.0_arm.ipk
ipkg install http://downloads.lacie.nas-central.org/Users/minosh/NetworkSpace2/ipkg_packages/libmcrypt-2.5.8_arm.ipk
ipkg install http://downloads.lacie.nas-central.org/Users/minosh/NetworkSpace2/ipkg_packages/mhash-0.9.9.9_arm.ipk
ipkg install http://downloads.lacie.nas-central.org/Users/minosh/NetworkSpace2/ipkg_packages/mcrypt-2.6.8_arm.ipk
ipkg install http://downloads.lacie.nas-central.org/Users/minosh/NetworkSpace2/ipkg_packages/php-5.6.7_arm.ipk


Edit "/opt/php-5.6.7/lib/php.ini" according to your needs.

If you want to use SSH2 php extension:
Code:
ipkg install libgcrypt
ipkg install http://downloads.lacie.nas-central.org/Users/minosh/NetworkSpace2/ipkg_packages/libssh2-1.4.3_arm.ipk


If you want to use imagick php extension:
Code:
ipkg install imagemagick


To replace lighttpd php
Code:
ngc --stop http
sed 's,/usr/bin/php-cgi,/opt/php-5.6.7/bin/php-cgi,' /etc/lighttpd/lighttpd.conf
ngc --start http


That's all I guess.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 15 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group