Jump to content

Compile PHP only for command-line use


Recommended Posts

Hello,

 

I have a NAS working with Apache, PHP and SQL. But PHP is version 5.2.14 and it's only upgradable with new firmware. (there is no new FW)

 

Can I compile PHP 5.3.x only for the command-line so that I can run my PHP scripts? (and not have to change the running version)

 

Dennis

 

 

Version of Linux: Linux version 2.6.33.2 (root@BuildEnv-00) (gcc version 4.2.1)

 

Link to comment
Share on other sites

You can't have one installation of PHP with multiple versions. Have multiple installations.

 

If your system's package manager doesn't do/allow that then you can build PHP from source and install to wherever you want. Then manually remove the CLI references (like /usr/bin/php) that point to the 5.2 version and put ones for 5.3 instead - though the 5.3 installer might do that for you.

Link to comment
Share on other sites

Ok, when I try that.....

[/php-5.3.6] # ./configure

loading cache ./config.cache

checking for Cygwin environment... no

checking for mingw32 environment... no

checking for egrep... grep -E

checking for a sed that does not truncate output... /bin/sedexpr: syntax error

./configure: line 2057: test: =: unary operator expected

checking host system type... ./config.guess: line 840: echo: write error: Broken pipe armv5tel-unknown-linux-gnueabi

checking target system type... armv5tel-unknown-linux-gnueabi

./configure: line 2226: ./build/shtool: Permission denied

./configure: line 2227: ./build/shtool: Permission denied

./configure: line 2230: ./build/shtool: Permission denied

./configure: line 2246: ./build/shtool: Permission denied

checking for gcc... no

checking for cc... no

configure: error: no acceptable cc found in $PATH

[/php-5.3.6] #

Link to comment
Share on other sites

What Linux distro are you running?

 

If check the version I get back: Linux version 2.6.33.2 (root@BuildEnv-00) (gcc version 4.2.1)

 

In the PHP version that will work I see /lib/ld-linux.so.3 and all other have .so.2 in it, maybe you know what the different is?

 

Dennis

Link to comment
Share on other sites

"Linux" is like saying "Windows". Yeah, okay, fine, but which Windows?

 

Uh... When the system boots up, and shows the loading screens and all that, does it give any names? Like Ubuntu or Red Hat or CentOS or anything like that?

Can you ask whoever installed the system what distro it is? And actually, if somebody else installed it, can you ask them to add PHP 5.3 as a second installation?

Link to comment
Share on other sites

"Linux" is like saying "Windows". Yeah, okay, fine, but which Windows?

 

Uh... When the system boots up, and shows the loading screens and all that, does it give any names? Like Ubuntu or Red Hat or CentOS or anything like that?

Can you ask whoever installed the system what distro it is? And actually, if somebody else installed it, can you ask them to add PHP 5.3 as a second installation?

 

Yeah, okay.....sorry.

It's a NAS (QNAP) with no VGA output, installed by the factory and the last update is 1 week ago. (with PHP 5.2.14)

 

I think it's a embedded Linux and I thought it was Linux version 2.6.33.2 (root@BuildEnv-00) (gcc version 4.2.1).

 

Is there another way to check the distro (distribution  ;) )

 

( I ask before and he say it's LINUX QNAP)

Link to comment
Share on other sites

Is there another way to check the distro (distribution  ;) )

cat /etc/*-release

or more likely try:

cat /etc/issue

 

[/share/HDA_DATA] # cat /etc/*-release

cat: /etc/*-release: No such file or directory

[/share/HDA_DATA] # cat /etc/issue

 

Welcome to QNAP Systems Inc,. NasX86(172.16.23.251) development environment.

 

[/share/HDA_DATA] #

 

(I saw in the source of the working PHP file linux-gnueabi)

Link to comment
Share on other sites

Looks like QNAP's own build of Linux... What does this give you?

# cat /proc/cpuinfo

You might be able to grab some Linux PHP binaries from somewhere, but only if they match the system type (which is x86 but I'd like to see a bit more first).

 

And why are you putting a web server on a NAS box anyways?

Link to comment
Share on other sites

Looks like QNAP's own build of Linux... What does this give you?

# cat /proc/cpuinfo

You might be able to grab some Linux PHP binaries from somewhere, but only if they match the system type (which is x86 but I'd like to see a bit more first).

 

[~] # cat /proc/cpuinfo

Processor      : Feroceon 88F6282 rev 1 (v5l)

BogoMIPS        : 1589.24

Features        : swp half thumb fastmult edsp

CPU implementer : 0x56

CPU architecture: 5TE

CPU variant    : 0x2

CPU part        : 0x131

CPU revision    : 1

 

Hardware        : Feroceon-KW ARM

Revision        : 0000

Serial          : 0000000000000000

 

I hoop you can help to grab some Linux PHP binarie.

 

And why are you putting a web server on a NAS box anyways?

QNAP called it a NAS, but it's a webserver/data-tank/Multimedia Station/ Download Station/Surveillance Station/iTunes Server....  ( http://qnap.com/pro_features.asp )

 

http://qnap.com/pro_detail_feature.asp?p_id=181

 

Link to comment
Share on other sites

Oh, it's ARM. Which the ./configure output even mentioned. Okay...

 

Not to say that there aren't, but I took a quick look and couldn't find any PHP binaries for ARM. The alternative is building from source.

I see two options:

a) It seems like some of the build tools are out of date. Those might require updating. But first, run configure as root and see how far that gets you. Also, Google around for the configure command-line arguments for an ARM processor - I saw a couple but don't remember where.

b) Hunt around for an ARM build of PHP 5.3. Probably worth the time.

 

But I'm wondering: where did you get your PHP from?

Link to comment
Share on other sites

requinix

There is no root user

admin:x:0:0:administrators:/share/homes/admin:/bin/sh

guest:x:65534:65534:guest:/share/homes/guest:/bin/sh

 

[~] # su

su: user root does not exist

[~] #

 

I have discovered that I can update (and that will work) to version 5.2.17 http://ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/php_5.2.17-1_arm.ipk

But I can't find  a newer version than 5.2.17 on that server :-(

 

Perhaps I can install a Linux version in VMware or virtual pc and compile a newer version and placed that on my QNAP for command-line scripts?

 

gizmola

I do not understand what you mean

 

 

 

Link to comment
Share on other sites

There is no root user

admin:x:0:0:administrators:/share/homes/admin:/bin/sh

guest:x:65534:65534:guest:/share/homes/guest:/bin/sh

Looks like it's called "admin" on your system (that 0:0 is the indicator). Why they would do that I don't know. Certainly non-standard.

 

Well PHP doesn't provide binaries for any linux distros directly, leaving that to the individual package maintainers.

Right. But since an ARM build has got to be fairly rare, there's a chance that somebody will have gone through the work to compile it and also make the build publicly available.

Link to comment
Share on other sites

I think I'm a little bit closer.

On http://queenie.dogagent.com/ I found php-5.3.3-4-arm.pkg.tar and  php-apache-optional-nopear-5.3.3-4-arm.pkg.tar and I have used that PHP (not PHP-CGI) for command-line use.

I have only used that PHP file and when I run it on the command-line I see the follow errror:

/share/HDA_DATA/Web/php: error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory

perhaps I need placed the so files en de PHP.ini in the correct root, but I don't know where. (and must I use the PHP-CGI file??)

 

Thanks,

Dennis

 

Some enduser of the QNAP NAS tolt me that QNAP's OS is based on BusyBox

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.