DSM-G600, DNS-3xx and NSA-220 Hack Forum

Unfortunately no one can be told what fun_plug is - you have to see it for yourself.

You are not logged in.

Announcement

#1 2007-02-22 17:58:48

catohagen
Member
Registered: 2007-02-22
Posts: 22

php

anyone have php running on the dns323 ? is there a precompiled archive somewhere ? or can i use php that work on dsmg600 ?

Offline

 

#2 2007-02-22 18:56:44

KRH
Member
From: Denmark
Registered: 2006-10-27
Posts: 219
Website

Re: php

you can not use the one from dsmg600, and i have tryed budt failed first time.

You can make a chroot and make it working whit debian.


First user to fun_plug the dns-323.

Offline

 

#3 2007-02-22 20:07:23

Apskaft
Member
From: Karlskrona, Sweden
Registered: 2007-01-09
Posts: 165

Re: php

KRH wrote:

you can not use the one from dsmg600, and i have tryed budt failed first time.

You can make a chroot and make it working whit debian.

I'm planning to do a crosscompile of php4 or php5 and use it with lighttpd. Hopefully not as painful as it was getting FireFly compiling in the D-Link environment. But, as it has already been ported to DSMG600 it should be possible since both are using uClibc.

But, forget about running a DB on the unit. Memory will (most likely) not handle it.

I will, as usual, post my findings here and write stuff in the Wiki. But, don't expect things to happen immediately as I have other obligations.

...and, you can always try for yourself. Follow the crosscompile instructions in the Wiki and look at the various buildscripts posted there. Just remember to share your findings....

/Apan

Last edited by Apskaft (2007-02-22 20:09:16)

Offline

 

#4 2007-02-22 21:32:14

sala
Member / Site Admin
From: Estonia
Registered: 2006-07-28
Posts: 731
Website

Re: php

php5 is piece of cake but php4 may need some patching first.
Look this topic for tips http://dns323.kood.org/forum/t24-lighttpd.html


DSM-G600 - NetBSD hdd-boot - 80GB Samsung SP0802N
NSA-220 - Gentoo armv5tel 20110121 hdd-boot - 2x 2TB WD WD20EADS

Offline

 

#5 2007-04-12 00:17:14

Raven
Member
Registered: 2007-04-06
Posts: 25

Re: php

Hi there,

anything new about PHP4 for the DNS? would be great to have a compiled file...

thanks a lot!

Offline

 

#6 2007-05-21 09:56:09

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

has anyone gotten php compiled to work on the dns-323 with lighttpd?

Offline

 

#7 2007-05-23 06:51:58

sshrum
New member
Registered: 2007-05-23
Posts: 3

Re: php

i'd love to see php on my DNS-323 :-)

Please do!

Offline

 

#8 2007-05-27 15:29:46

qwertybnm
Member
Registered: 2007-05-27
Posts: 11

Re: php

Hope this is not a stupid question Apskaft, but why couldn't you just run the database off a fast USB stick?

Offline

 

#9 2007-05-27 15:48:02

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: php

mykroft wrote:

has anyone gotten php compiled to work on the dns-323 with lighttpd?

just tried (php 5.2.2). failed because the d-link toolchain doesn't include c++ compiler and libs.

Edit: I searched for c++ source files, and found only one and that one seems to be a test program.
It seems to compile after I running "autoconf" before configure....

Last edited by fonz (2007-05-27 16:24:08)

Offline

 

#10 2007-05-31 22:21:47

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

Did you get this successfully compiled?  I have not been able to get my linux box setup correctly yet to cross compile..... sad

Myk

Offline

 

#11 2007-05-31 23:36:44

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: php

Yes. It compiled and I tested a phpinfo() page. I attached my compile script. I had some trouble with zlib, though, might be better to disable for first try. D-Link's firmware uses zlib as well, but it's not installed (fw 1.02) so I had to install zlib myself. Then the pain started... php didn't find zlib and such. I though about including a basic php, but I won't until I learn how to link zlib statically into the php binary.

PS: fw103-scripts package on my site contains the scripts I'm using to create the cross-toolchain.

Last edited by fonz (2007-05-31 23:41:21)

Offline

 

#12 2007-06-01 09:18:44

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

ok, will try it again tongue

Offline

 

#13 2007-06-01 10:43:36

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

ok, where I am getting stuck, actually unshure is in the editing of the qemu stuff.

I am not sure what to do about the ip addresses etc for the config of it.

I have never used/heard of qemu before - can you explain these settings so I know what to do with them?

Thanks
Myk

Offline

 

#14 2007-06-01 11:19:37

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

ok, after getting a couple of more utils (might want to add those to the readme as I did not have them..... dunno) and blindly editing some of the ip config stuff I am getting the following

Code:

[root@fileserver bobclfs]# sh qemu/run.sh 
+ '[' -r qemu/run.sh ']'
+ cd qemu
+ RAM=256
+ /sbin/ifconfig tap1
+ '[' 1 -ne 0 ']'
++ pwd
+ su root -c /opt/dns323/bobclfs/qemu/setup.sh
RTNETLINK answers: File exists
/opt/dns323/bobclfs/qemu/setup.sh: line 40: /proc/sys/net/ipv4/conf/eth1/proxy_arp: No such file or directory
OK
+ TARGET=armv5l-unknown-linux-uclibc
++ pwd
+ CROSSTOOLS=/opt/dns323/bobclfs/qemu/../mnt/cross-tools/armv5l-unknown-linux-uclibc/bin
+ '[' -d /opt/dns323/bobclfs/qemu/../mnt/cross-tools/armv5l-unknown-linux-uclibc/bin ']'
+ killall distccd
+ sleep 1
++ pwd
+ DISTCCD_PATH=/opt/dns323/bobclfs/qemu/../mnt/cross-tools/armv5l-unknown-linux-uclibc/bin
+ TMPDIR=/dev/shm
+ distccd --daemon --allow 0/0 --log-file /opt/dns323/bobclfs/qemu/distccd.log
+ '[' -r zImage ']'
+ '[' -r initramfs.cpio.gz ']'
+ qemu-system-arm -M versatilepb -kernel zImage -initrd initramfs.cpio.gz -hda root_fs -append console=ttyAMA0,115200 -net nic -net tap,ifname=tap1,script=no -serial stdio -m 256
Could not initialize SDL - exiting

And do not know what to do now...

Assistance please if you have time - im sorry for being a pain - crosscompiling is completly new to me....

btw - mine is comming up tap0 - not tap1 like your scripts.....

Myk

Last edited by mykroft (2007-06-01 11:21:14)

Offline

 

#15 2007-06-01 11:54:28

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

ok, farther along....

did know I had to start the blody thing in a X window smile

ok, now i am at

-----
In qemu, mount sources and compile samba:
  mount /mnt
  cd /mnt/bobclfs
  sh native/samba.sh
-----

am not sure what you mean by sources and the mount /mnt line.....

there is nothing in the qemu window to mount....

Also my qemu window - net traffic can not get to the outside world - its setting my gateway at 192.168.0.0....  I can not even ping my router at 192.168.0.1

Im slowing learning sad

Myk

update - for some reason my eth0 device is getting a bcast on your 10.x.x.x lan setup - i can not find where you have that setup.....

Last edited by mykroft (2007-06-01 12:11:08)

Offline

 

#16 2007-06-01 12:56:38

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: php

Huh. You don't need qemu, no need to comile samba, don't do the bobclfs stuff. You only need the D-LINK TOOLCHAIN, and maybe the fun-toolchain-env.sh script from funplug scources. Not more!

Offline

 

#17 2007-06-01 13:36:37

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: php

Here's some more info. After running the D-LINK TOOLCHAIN commands, i.e. after the first world.sh in my instructions, you should find the cross-tools in /opt/dns323/fw103/crosstools/gcc-3.3.x/toolchain_arm/bin - a lot of programs starting with "arm-linux-uclibc-".

To use the toolchain to compile php, you need to set a number of environment variables (CC, CXX, AR, ...) and the PATH to use these cross-tools. That's what the fun-toolchain-env.sh from the funplug sources does.

So maybe the easiest way to get you going might be to download and unpack the FUN-PLUG as well, but it shouldn't be necessary to run world.sh or make-image.
After unpacking the fun-plug sources, cd to the funplug directory (the one containing fun-toolchain-env.sh), and run:

Code:

source ./fun-toolchain-env.sh

If all went well so far, verify that your cross-compiler is actually there:

Code:

tp@motte:/opt/dns323/funplug$ $CC -v
 (...)
gcc version 3.3.3

Now proceed to compile php:

Code:

tar xjf php-5.2.2.tar.bz2 
cd php-5.2.2
autoconf

./configure \
     --cache-file=config.cache \
     --host=${FUN_TARGET} \
     --prefix=${FUNPLUGDIR} \
     --bindir=${BINDIR} \
     --sbindir=${BINDIR} \
     --libdir=${BINDIR}/lib \
     --libexecdir=${BINDIR}/lib \
     --sysconfdir=${ETCDIR} \
     --disable-all \
     --enable-shared=yes --enable-static=no \
     --enable-fastcgi \
     CFLAGS="${BUILD} ${FUN_CFLAGS} ${FUN_LIBS}"

make -j4

cd sapi/cgi
mv php php-cgi

Done. php-cgi in sapi/cgi/ is the php binary. Copy it to fun_plug.d/bin/, then enable fast-cgi for lighttpd, edit lighttpd.conf and add:

Code:

fastcgi.server = ( ".php" => ((
    "bin-path"  => "/mnt/HD_a2/fun_plug.d/bin/php-cgi",
    "socket"    => "/tmp/php-cgi.socket",
    "max-procs" => 2
)))

and uncomment the "mod_fastcgi" line in the server.modules list. Start/restart lighttpd and it should run "*.php" files.

Offline

 

#18 2007-06-01 22:51:29

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

Got it smile

Thanks for the push in the right direction

Offline

 

#19 2007-06-02 09:22:55

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

quick question

do you know the command line param on the ./configure to enable pcre-support

am trying to get simpleblog running and am getting

Fatal error: Call to undefined function preg_match() in /mnt/HD_a2/fun_plug.d/www/pages/install05.php on line 10

Thanks
Myk

Offline

 

#20 2007-06-03 01:51:41

catohagen
Member
Registered: 2007-02-22
Posts: 22

Re: php

any chance of a precompiled php binary to download ?

Offline

 

#21 2007-06-03 02:13:03

fonz
Member / Developer
From: Berlin
Registered: 2007-02-06
Posts: 1716
Website

Re: php

mykroft wrote:

do you know the command line param on the ./configure to enable pcre-support

Try

Code:

./configure --help | less

It should show all the available options. But I think you will also need to compile the pcre library in order to use it...

Offline

 

#22 2007-06-03 08:06:26

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

catohagen wrote:

any chance of a precompiled php binary to download ?

Im working on it, when I get to my satisfaction, I will post a binary of it

Myk

Offline

 

#23 2007-06-10 22:45:06

WildSioux
Member
Registered: 2007-03-05
Posts: 71

Re: php

mykroft wrote:

catohagen wrote:

any chance of a precompiled php binary to download ?

Im working on it, when I get to my satisfaction, I will post a binary of it

Myk

Myk...any progress made on the PHP binary?

Offline

 

#24 2007-06-11 05:20:03

mykroft
Member
Registered: 2007-05-12
Posts: 83

Re: php

Not yet, I asked in the DSM-G600 forums since they were able to get a semi complete version compiled and got snub'ed.

Work has kept me busy this last week, but hopefully I will be able to continue on it this week.

Offline

 

#25 2007-06-13 03:33:44

WildSioux
Member
Registered: 2007-03-05
Posts: 71

Re: php

mykroft wrote:

Not yet, I asked in the DSM-G600 forums since they were able to get a semi complete version compiled and got snub'ed.

Work has kept me busy this last week, but hopefully I will be able to continue on it this week.

Yeah, I read your post and the comment made in the DSM-G600 forum.  That was not the question you asked.

I wish I could get php to work on this since there are a few things I would like to do.  Why couldn't we just install the PHP binary or source code from http://www.php.net/ ?

I tried this one day and gave it the "sh" command.  It said that it couldn't load a few of the files needed.  So I moved those files to the folder it was looking for and it didn't give me any errors but I don't think the php was loaded.

Offline

 

Board footer

Powered by PunBB
© Copyright 2002–2010 PunBB