dennisonline Posted May 3, 2011 Share Posted May 3, 2011 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) Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/ Share on other sites More sharing options...
requinix Posted May 3, 2011 Share Posted May 3, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1209931 Share on other sites More sharing options...
dennisonline Posted May 3, 2011 Author Share Posted May 3, 2011 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] # Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1209974 Share on other sites More sharing options...
requinix Posted May 3, 2011 Share Posted May 3, 2011 What Linux distro are you running? Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210019 Share on other sites More sharing options...
dennisonline Posted May 3, 2011 Author Share Posted May 3, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210057 Share on other sites More sharing options...
requinix Posted May 3, 2011 Share Posted May 3, 2011 "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? Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210071 Share on other sites More sharing options...
dennisonline Posted May 3, 2011 Author Share Posted May 3, 2011 "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) Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210077 Share on other sites More sharing options...
Maq Posted May 3, 2011 Share Posted May 3, 2011 Is there another way to check the distro (distribution ) cat /etc/*-release or more likely try: cat /etc/issue Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210079 Share on other sites More sharing options...
dennisonline Posted May 3, 2011 Author Share Posted May 3, 2011 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) Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210085 Share on other sites More sharing options...
requinix Posted May 3, 2011 Share Posted May 3, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210120 Share on other sites More sharing options...
dennisonline Posted May 4, 2011 Author Share Posted May 4, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210290 Share on other sites More sharing options...
requinix Posted May 4, 2011 Share Posted May 4, 2011 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? Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210577 Share on other sites More sharing options...
gizmola Posted May 4, 2011 Share Posted May 4, 2011 Well PHP doesn't provide binaries for any linux distros directly, leaving that to the individual package maintainers. Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210582 Share on other sites More sharing options...
dennisonline Posted May 5, 2011 Author Share Posted May 5, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1210992 Share on other sites More sharing options...
gizmola Posted May 5, 2011 Share Posted May 5, 2011 I was just replying to something requinix posted. Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1211019 Share on other sites More sharing options...
requinix Posted May 5, 2011 Share Posted May 5, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1211137 Share on other sites More sharing options...
dennisonline Posted May 6, 2011 Author Share Posted May 6, 2011 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 Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1211700 Share on other sites More sharing options...
requinix Posted May 6, 2011 Share Posted May 6, 2011 That PHP build was compiled with support for PCRE (preg_match() and friends) but it sounds like it's not on your system. Can't load what isn't there. Quote Link to comment https://forums.phpfreaks.com/topic/235431-compile-php-only-for-command-line-use/#findComment-1211721 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.