Firmware: A-410 [01 Apr. 2014] | A-400 [12 Mar. 2014] | C-300 [13 Feb. 2014] | A-300 [24 Feb. 2014] | C-200 [11 July 2013] | A-200/A-210 [11 July 2013] | Popbox V8 [3 Dec 2013]

Just got your NMT | WIKI has the answers | Search the forum | Forum Rules/Policy | Firmware & Official NMT News | Popcornhour manuals



User(s) browsing this thread: 1 Guest(s)
Post Reply 
Faster PHP server CSI package
10-01-2009, 11:23 PM
Post: #136
RE: Faster PHP server CSI package
(09-26-2009 01:45 PM)bellissimo Wrote:  Hi. Thought I would try to get MPDJB working with lighttpd (as installed from CSI). I get the message:

Code:
This PHP script has been encoded with Turck MMcache, to run in you must install Turck MMcache or Turck Loader

Is this another module that needs to be compiled into lighttpd, or a config somewhere?

Here is what I did to run MPDJB with the CSI lighttpd package.

A110 (1.5 TB 3.5" HDD) / A200 (fanless case by moovika, 500 GB 2.5" HDD) / C200 (no HDD, no BD)
Yamaha RX-V3900 - Panasonic TX-P42V10 - B&W CT7.5 + Velodyne CHT-10Q - Logitech Harmony 525
Linksys WRT320N - Netgear GS608 - Fit-PC2 + USB HDD (NFS, SMB, DLNA server) - Synology DS411j
Find all posts by this user
Add Thank You Quote this message in a reply
10-02-2009, 01:21 AM
Post: #137
RE: Faster PHP server CSI package
Is there any way to get GD library working for PHP?
Find all posts by this user
Add Thank You Quote this message in a reply
10-02-2009, 09:34 AM
Post: #138
RE: Faster PHP server CSI package
According to the first post, GD is included.
Find all posts by this user
Add Thank You Quote this message in a reply
10-02-2009, 09:53 AM
Post: #139
RE: Faster PHP server CSI package
Excellent work, thank you for putting this together.
Find all posts by this user
Add Thank You Quote this message in a reply
10-05-2009, 02:53 PM (This post was last modified: 10-06-2009 08:19 PM by michaelr64.)
Post: #140
RE: Faster PHP server CSI package
Hi,

Two questions really :
- Can this be used with the C200 ?
- Can/is mod_rewrite (be) included ?
-and even mod_ssl ?

thx

EDIT 06-10-2009: I want to create a single page with holds a link to all services that are available on the pch.
With mod_rewrite i can then send the browser to the right service, e.g. nzbget on 8066, when someone clicks this link.
Mod_rewrite can send requests for say: nzb.mydomain.com to localhost:8066 etc.
(This: mydomain.com/nzb to localhost:8066 is also possible but more errorprone of course)
When i then use port-forwarding to route all traffic on port 80 on the wan side of the router to the port of the lighttpd server, i can then access all running services trough one port.
All i need is a domain.

And lighttpd with mod_rewrite(and mod_proxy ofcourse....) and possible mod_ssl.
If one makes the virtual host section so that it loads them from disk one could even load automatically all vhosts files for every service on the pch.
One could make this an option for every package in the CSI package that has a webserver on board: let them place a file with predefined vhosts format in the webserver/vhost dir.
And then when the server starts it would autmatically load all vhost mappings for every webserver.
One could even make a bit of code that on startup would parse the vhost files so that you could create an index.htm file.
You can make use of the commenting possibilties in the vhosts file.
(Thhis coding section is beyond me really unfortunately; i know squat about php or unix).


PCH-A110 ,
C-200, Pioneer PDP-LX5090H , Pioneer SC-LX72 Tongue,
Vifa Premium 22 XT, Peerless XLS-10 Sub
Find all posts by this user
Add Thank You Quote this message in a reply
10-07-2009, 09:19 PM (This post was last modified: 10-07-2009 09:20 PM by joshua.lyon.)
Post: #141
RE: Faster PHP server CSI package
(09-17-2009 04:43 PM)vaidyasr Wrote:  @accident
No. I am not using fread, I am using stat only. But I am getting the filesize from shell_exec and dividing inside php. So, it is not handling the integer that big. But as pbman stated, if I handle the size by dividing the shell_exec output directly instead of storing into a variable, probably it should work.
I had the same issue and instead of using an integer (which PHP tried to do by default) I used a float.

Anything beyond 2^31 (which is 2 gigabytes in bytes) should normally cause an integer overflow which should cause the variable to be interpreted as a float. For some reason this wasn't working for me, so I simply made all filesize variables as floats.

PHP Code:
/*  Example which didn't work */
$bytes getmyfilesize('somefile.mkv'//somefile.mkv is greater than 2 GB
echo $bytes // only shows 2^31 -- and is of type integer

/* Using (float) variables works. */
(float)$bytes getmyfilesize('somefile.mkv')
echo 
$bytes // properly shows value of somefile.mkv and is a float 

This is in the PHP Manual on the Integer page... but it looks like the manual is down right now. Google's cached version should still be up though.

NewzBook - Automatic Newzbin bookmark fetcher, Newzbin search, and NZBget interface (mobile phone friendly)
http://boshdirect.com - my website / blog about technology, automotive, and general interests.
Find all posts by this user
Add Thank You Quote this message in a reply
10-09-2009, 04:55 AM (This post was last modified: 10-14-2009 03:22 PM by joshua.lyon.)
Post: #142
RE: Faster PHP server CSI package
Does anyone know what user the php files are run as? per the output of the 'top' command, it's running as 'nobody'
Just curious what kind of limitations we will run into coding PHP on the PCH. For example, certain commands don't work:
PHP Code:
unset($output);
exec("whoami",$output);
print_r($output); //I was at least hoping for 'nobody'

unset($output);
exec("crontab -l"$output);
print_r($output); //nothing :( 

NewzBook - Automatic Newzbin bookmark fetcher, Newzbin search, and NZBget interface (mobile phone friendly)
http://boshdirect.com - my website / blog about technology, automotive, and general interests.
Find all posts by this user
Add Thank You Quote this message in a reply
10-14-2009, 06:12 AM
Post: #143
RE: Faster PHP server CSI package
@journey4712

The php function scandir in lighttpd does not recognize the files which is bigger than 2GB. Is there is any compile settings you missed out?

Sriram
C200/A400/RPi - Onkyo HT-S3400 - LG 47LV3730

oPKG Available Packages and Info:
400 Series - 200/300 Series - 100 Series
Find all posts by this user
Add Thank You Quote this message in a reply
10-17-2009, 10:25 AM
Post: #144
RE: Faster PHP server CSI package
Hi !

I tried to install "lightttpd' via CSI : it fails.
I tried to install in command line : it fails again.

Now, I can't use anything using the 9999 port.

Cf. http://www.networkedmediatank.com/showth...?tid=29806


After using NMT CSI, my box is very very slow, and all my services are "starting".
If I delete the "/share/Apps/AppInit" directory, things are better, but the "torrent" and "usenet" services are still "starting" and my 9999 port is no more available.


You seems to know well how this "configuration things" works.
Could you help me ?
Find all posts by this user
Add Thank You Quote this message in a reply
10-18-2009, 05:41 PM
Post: #145
RE: Faster PHP server CSI package
@journey4712
Can you please let me know whether the lighttpd compiled with -D_FILE_OFFSET_BITS?. Because I can't interpret the >2GB files with lighttpd. I found the below solution in php.net

Code:
If you want to open large files (more than 2GB) that's what I did and it works: you should recompile your php with the CFLAGS="-D_FILE_OFFSET_BITS=64"

Sriram
C200/A400/RPi - Onkyo HT-S3400 - LG 47LV3730

oPKG Available Packages and Info:
400 Series - 200/300 Series - 100 Series
Find all posts by this user
Add Thank You Quote this message in a reply
10-20-2009, 10:19 PM (This post was last modified: 10-20-2009 10:20 PM by designcomputer.)
Post: #146
RE: Faster PHP server CSI package
Hey journey4712,

First, thanks for all of the hours you have put in to get lighttpd up and running.

I have run into an issue when accessing more than one php file simultaneously. Adjusting max-procs to "2" cures the problem but then fastcgi sometimes fails to load.

************* from lighttpd.conf *****************

fastcgi.server = (
".php" => ((
"bin-path" => instdir+"bin/php-cgi -c "+instdir+"etc/",
"socket" => instdir+"/run/php.socket",
"min-procs" => 1,
"max-procs" => 2,
))

************* from error.log **************

2009-10-20 15:57:09: (log.c.172) server started
2009-10-20 15:57:09: (mod_fastcgi.c.1087) the fastcgi-backend /share/Apps/lighttpd/bin/php-cgi -c /share/Apps/lighttpd/etc/ failed to start:
2009-10-20 15:57:09: (mod_fastcgi.c.1091) child exited with status 16 /share/Apps/lighttpd/bin/php-cgi -c /share/Apps/lighttpd/etc/
2009-10-20 15:57:09: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2009-10-20 15:57:09: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.

**************************************

Am I making any obvious mistakes?

Thanks again,
Dana
Find all posts by this user
Add Thank You Quote this message in a reply
10-22-2009, 09:10 PM
Post: #147
RE: Faster PHP server CSI package
(10-20-2009 10:19 PM)designcomputer Wrote:  Hey journey4712,

First, thanks for all of the hours you have put in to get lighttpd up and running.

I have run into an issue when accessing more than one php file simultaneously. Adjusting max-procs to "2" cures the problem but then fastcgi sometimes fails to load.

************* from lighttpd.conf *****************

fastcgi.server = (
".php" => ((
"bin-path" => instdir+"bin/php-cgi -c "+instdir+"etc/",
"socket" => instdir+"/run/php.socket",
"min-procs" => 1,
"max-procs" => 2,
))

************* from error.log **************

2009-10-20 15:57:09: (log.c.172) server started
2009-10-20 15:57:09: (mod_fastcgi.c.1087) the fastcgi-backend /share/Apps/lighttpd/bin/php-cgi -c /share/Apps/lighttpd/etc/ failed to start:
2009-10-20 15:57:09: (mod_fastcgi.c.1091) child exited with status 16 /share/Apps/lighttpd/bin/php-cgi -c /share/Apps/lighttpd/etc/
2009-10-20 15:57:09: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2009-10-20 15:57:09: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.

**************************************

Am I making any obvious mistakes?

Thanks again,
Dana

Here is how I fixed this problem.

************* from lighttpd.conf *****************

fastcgi.server = (
".php" => ((
"bin-path" => instdir+"bin/php-cgi -c "+instdir+"etc/",
"socket" => instdir+"/run/php.socket",
"min-procs" => 1,
"max-procs" => 1,
"bin-environment" => (
"PHP_FCGI_CHILDREN" => "4",
"PHP_FCGI_MAX_REQUESTS" => "10"
),

))



Much more info is available here:

http://redmine.lighttpd.net/wiki/lighttp...nceFastCGI
Find all posts by this user
Add Thank You Quote this message in a reply
10-23-2009, 11:59 AM
Post: #148
RE: Faster PHP server CSI package
Hi guys,

Recently I have installed "lighttpd v1.4.23-nmt2" on my A-110 Popcorn but regarding the options in the php installed with this server I can't receive SOAP messages with this Sad

Please, ... do you know how can I fix this ? ... perhaps I'd need to install another WebServer or I could be possible to enable the SOAP extension for the current php installed in some way ?

Regards,
Keko.
Find all posts by this user
Add Thank You Quote this message in a reply
10-23-2009, 03:38 PM
Post: #149
RE: Faster PHP server CSI package
Out of curiosity, why does the configuration (in phpinfo()) show:
Code:
'--with-jpeg-dir=/home/xbmc/cross/jpeg-6b/DEST/' '--with-freetype-dir=/home/xbmc/cross/freetype-2.3.5.orig/freetype-2.3.5/DEST/'

Full snippet:
Configure Command:
Code:
'./configure' '--host=mipsel-linux-uclibc' '--without-pear' '--with-iconv=/home/xbmc/cross/libiconv-1.12/DEST' '--enable-fastcgi' '--enable-sockets' '--with-libxml-dir=/share/Apps/lighttpd' '--prefix=/share/Apps/lighttpd/' '--with-zlib=/home/xbmc/cross/zlib-1.2.3/DEST' '--with-gd' '--with-openssl=/home/xbmc/packages/share/Apps/OpenSSL/' '--with-xsl=/share/Apps/lighttpd' '--with-jpeg-dir=/home/xbmc/cross/jpeg-6b/DEST/' '--with-freetype-dir=/home/xbmc/cross/freetype-2.3.5.orig/freetype-2.3.5/DEST/'

NewzBook - Automatic Newzbin bookmark fetcher, Newzbin search, and NZBget interface (mobile phone friendly)
http://boshdirect.com - my website / blog about technology, automotive, and general interests.
Find all posts by this user
Add Thank You Quote this message in a reply
11-17-2009, 12:19 PM (This post was last modified: 11-17-2009 12:22 PM by Knoot.)
Post: #150
RE: Faster PHP server CSI package
This application makes the NZBGet fail.. anyone know how to solve it?

Quote:Tue Nov 17 11:16:02 2009 ERROR Binding socket failed for 127.0.0.1: ErrNo 125, Address already in use
Tue Nov 17 11:16:03 2009 ERROR Binding socket failed for 127.0.0.1: ErrNo 125, Address already in use
Tue Nov 17 11:16:03 2009 ERROR Binding socket failed for 127.0.0.1: ErrNo 125, Address already in use
Tue Nov 17 11:16:04 2009 ERROR Binding socket failed for 127.0.0.1: ErrNo 125, Address already in use
Tue Nov 17 11:16:04 2009 ERROR Binding socket failed for 127.0.0.1: ErrNo 125, Address already in use
spams me with that.. (In the nzbget.log)
Find all posts by this user
Add Thank You Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Serviio (DLNA server) RXP 3 4,319 12-30-2012 11:14 AM
Last Post: mikk
  ftp server and upload images from ipcam defer 8 7,470 02-11-2012 04:48 PM
Last Post: vanquish99
  HTTP streaming server on A110 ? dony71 0 1,994 01-26-2012 02:48 AM
Last Post: dony71
  A-110 used like server db to store sensor data csorda 0 1,528 01-18-2012 04:06 PM
Last Post: csorda
Music fuppes 0.629 for NMT - dlna, upnp media server [UPDATED: 31-May-2009] Mr Segfault 53 54,678 10-12-2011 01:04 AM
Last Post: spud
  OpenSSH for SFTP server? dony71 0 1,150 09-30-2011 05:32 AM
Last Post: dony71
  web server manifest support harrykausl 0 1,558 07-20-2011 09:35 AM
Last Post: harrykausl
  Help with Server Timeout Error running a script hindibuff 0 2,154 03-29-2011 06:21 AM
Last Post: hindibuff
Bug Executing a script on the server from the NMT? johnk 6 4,144 02-21-2011 10:59 PM
Last Post: johnk
  Popcorn does not see Twonky or PS3 Media Server rgn2000 0 3,980 09-02-2010 09:14 PM
Last Post: rgn2000

Forum Jump: