0
votes

I have cross-compiled PHP5.2.13 for ARM processor running Linux. Following is the commands I used:-

  1. export PATH=/usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/bin:$PATH /usr/local/DigiEL-5.9/x-tools/arm-cortex_a8-linux-gnueabi/arm-cortex_a8-linux-gnueabi/sysroot/usr/
  2. CC=arm-linux-gcc ./configure --host=arm-linux --prefix=/usr --without-iconv --disable-xml --without-pear --disable-libxml --disable-dom --disable-simplexml --disable-xmlreader --disable-xmlwriter
  3. make INSTALL_ROOT=$HOME/phpinstall install

On the target Machine I have executed the following command scp test@sourceIP:/home/test/phpinstall/usr/bin/* ./

Now on the target machine executed cd /usr/bin I could see the php, php-cgi, php-conf,phpize files. I have the environment path as well. But when I executed php -v. it throws the following error.

/usr/bin/php: line 1: syntax error: unexpected word (expecting ")")

Any help is much appreciated.

1
I checked in Google but invainJag
Thank You Peter for formatting, Initial Format was lost after posting and I couldn't reformat.Jag
Finally, it worked. Just added few more parameters to 'Make' command and it worked. make HOSTCC=gcc CXX=arm-linux-c++ CC=arm-linux-gccJag

1 Answers

0
votes

use 'make HOSTCC=gcc CXX=arm-linux-c++ CC=arm-linux-gcc' instead of using 'make' alone followed by 'make INSTALL_ROOT=$HOME/phpinstall install'. Now copy the php, php-cgi files into the target machine. Set the path export PATH=usr/bin:$PATH. Test : execute php-cgi -v command. from /usr/bin directory. Example /usr/bin # php-cgi -v. Output : PHP 5.4.0 (cgi-fcgi) (built: Jul 26 2017 09:07:16) Copyright (c) 1997-2012 The PHP Group