cross-compiled THTTPD server with PHP runs fine, but no PHP

CJwGtGD

New Member
We need some PHP on an ARM board. I've successfully cross-compiled both PHP 5 and THTTPD and they both seem to run fine on the ARM board, only the .php pages are shown unprocessed (if you do "View Source" in the web browser, you can see the PHP code).It has to be a silly configuration detail, I really feel that I am snatching defeat from the jaws of victory. Any help or smart ideas would be greatly appreciated!Here are my steps to build, deploy and test:My thttpd.conf file is:\[code\]dir=/srv/wwwphppat=**phpspat=**.phplogfile=/srv/www/logs/web.lognochrootport=80\[/code\]My procedure was:\[code\]cd ~/packages/php/tar xjvf php-5.2.1.tar.bz2cd ~/packages/thttpd/tar xzvf thttpd-2.21b.tar.gzcd ~/packages/php/php-5.2.1/mkdir install-armexport CC=/bin/arm-linux-gccexport CXX=/bin/arm-linux-cpp./configure --host=i386-linux-gnu --target=arm --prefix=install-arm \--disable-short-tags --without-mysql \--without-pear --disable-all --disable-short-tags--enable-force-cgi-redirect --enable-discard-path \--with-thttpd=../../thttpd/thttpd-2.21bmakemake installcd ~/packages/thttpd/thttpd-2.21bexport CC=/bin/arm-linux-gccexport CXX=/bin/arm-linux-c++export CPP=/bin/arm-linux-c++./configure --host=i386-linux-gnu --target=arm --prefix=/srv/www# I got compiling errors for thttpd.c caused by the ifdef condition not happening and # an include file not added. Deleted the ifdef/end if and recompiled. This # necessary for two files.################ in file thttpd.c changed: #ifdef HAVE_FCNTL_H #include <fcntl.h> #endif# to: #include <fcntl.h>############### in file fdwatch.c changed: #ifdef HAVE_POLL_H #include <poll.h> #else /* HAVE_POLL_H */ #ifdef HAVE_SYS_POLL_H #include <sys/poll.h> #endif /* HAVE_SYS_POLL_H */ #endif /* HAVE_POLL_H */# to: #include <poll.h># also tried: #include <sys/poll.h># (both work)make# to make sure we get 0 (success) despite the warnings:echo $?# no make install, all references indicated it's broken and I also got errors# where directories with the same name prevented files from being written.########## deployment to board# copied "php" and "thttpd" executables in /usr/sbin using following command# in Cutecom:cd /usr/sbintftp -g -r php 192.168.1.25tftp -g -r thttpd 192.168.1.25chmod +x phpchmod +x thttpd# unsure, should I get a libphp5.so ? Where is it?:# tried:# cd /usr/lib# tftp -g -r libphp5.a 192.168.1.25# chmod +rxcd /srv/wwwmkdir confcd conftftp -g -r thttpd.conf 192.168.1.25cd /srv/usr/sbin/thttpd -C /srv/www/conf/thttpd.conf# HTML pages and images displayed fine, test.php is passed without pre-processing,# contains:# <?# phpinfo();# ?>############## Testing if PHP works on the ARM boardroot@arago:/srv/www/cgi-bin# php -vPHP 5.2.1 (cli) (built: Sep 27 2010 10:59:59) Copyright (c) 1997-2007 The PHP GroupZend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologiesroot@arago:/srv/www/cgi-bin# php -r 'phpinfo();'phpinfo()PHP Version => 5.2.1System => Linux arago 2.6.33-rc4 #1 PREEMPT Thu Mar 25 15:06:29 IST 2010 armv5tejlBuild Date => Sep 27 2010 11:30:59Configure Command => './configure' '--host=i386-linux-gnu' '--target=arm''--prefix=install-arm' '--disable-short-tags' '--without-mysql' '--without-pear' '--disable-all' '--disable-short-tags' '--enable-force-cgi-redirect' '--enable-discard-path' '--with-thttpd=../../thttpd/thttpd-2.21b'Server API => Command Line InterfaceVirtual Directory Support => disabledConfiguration File (php.ini) Path => install-arm/libPHP API => 20041225PHP Extension => 20060613Zend Extension => 220060519Debug Build => noThread Safety => disabledZend Memory Manager => enabledIPv6 Support => enabledRegistered PHP Streams => php, file, data, http, ftp Registered Stream Socket Transports => tcp, udp, unix, udgRegistered Stream Filters => string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumedThis program makes use of the Zend Scripting Language Engine:Zend Engine v2.2.0, Copyright (c) 1998-2007 Zend Technologies _______________________________________________________________________ConfigurationPHP CoreDirective => Local Value =http://stackoverflow.com/questions/3817685/> Master Valueallow_call_time_pass_reference => On => Onallow_url_fopen => On => Onallow_url_include => Off => Offalways_populate_raw_post_data => Off => Offarg_separator.input => & => &arg_separator.output => & => &asp_tags => Off => Offauto_append_file => no value => no valueauto_globals_jit => On => Onauto_prepend_file => no value => no valuebrowscap => no value => no valuedefault_charset => no value => no valuedefault_mimetype => text/html => text/htmldefine_syslog_variables => Off => Offdisable_classes => no value => no valuedisable_functions => no value => no valuedisplay_errors => On => Ondisplay_startup_errors => Off => Offdoc_root => no value => no valuedocref_ext => no value => no valuedocref_root => no value => no valueenable_dl => On => Onerror_append_string => no value => no valueerror_log => no value => no valueerror_prepend_string => no value => no valueerror_reporting => no value => no valueexpose_php => On => Onextension_dir => install-arm/lib/php/extensions/no-debug-non-zts-20060613 => install- arm/lib/php/extensions/no-debug-non-zts-20060613file_uploads => On => Onhighlight.bg => <font style="color: #FFFFFF">#FFFFFF</font> => <font style="color: #FFFFFF">#FFFFFF</font> highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color:#DD0000">#DD0000</font>html_errors => Off => Offignore_repeated_errors => Off => Offignore_repeated_source => Off => Offignore_user_abort => Off => Offimplicit_flush => On => Oninclude_path => .: => .:log_errors => Off => Offlog_errors_max_len => 1024 => 1024magic_quotes_gpc => On => Onmagic_quotes_runtime => Off => Offmagic_quotes_sybase => Off => Offmail.force_extra_parameters => no value =http://stackoverflow.com/questions/3817685/> no valuemax_execution_time => 0 => 0max_input_time => -1 => -1memory_limit => 128M => 128Mopen_basedir => no value => no valueoutput_buffering => 0 => 0output_handler => no value => no valuepost_max_size => 8M => 8Mprecision => 14 => 14realpath_cache_size => 16K => 16Krealpath_cache_ttl => 120 => 120register_argc_argv => On => Onregister_globals => Off => Offregister_long_arrays => On => Onreport_memleaks => On => Onreport_zend_debug => Off => Offsafe_mode => Off => Offsafe_mode_exec_dir => /usr/local/php/bin => /usr/local/php/binsafe_mode_gid => Off => Offsafe_mode_include_dir => no value => no valuesendmail_from => no value => no valuesendmail_path => -t -i => -t -i serialize_precision => 100 => 100short_open_tag => Off => OffSMTP => localhost => localhostsmtp_port => 25 => 25sql.safe_mode => Off => Offtrack_errors => Off => Offunserialize_callback_func => no value => no valueupload_max_filesize => 2M => 2Mupload_tmp_dir => no value => no valueuser_dir => no value => no valuevariables_order => EGPCS => EGPCSxmlrpc_error_number => 0 => 0xmlrpc_errors => Off => Offy2k_compliance => On => Onzend.ze1_compatibility_mode => Off => Offdatedate/time support => enabledTimezone Database Version => 2006.16Timezone Database => internalDefault timezone => UTCDirective => Local Value => Master Valuedate.default_latitude => 31.7667 => 31.7667date.default_longitude => 35.2333 => 35.2333date.sunrise_zenith => 90.583333 => 90.583333date.sunset_zenith => 90.583333 => 90.583333date.timezone => no value => no valueReflectionReflection => enabledVersion => $Id: php_reflection.c,v 1.164.2.33.2.33 2007/01/01 09:36:05 sebastian Exp $standardRegex Library => Bundled library enabledDynamic Library support not available<br />.Directive => Local Value => Master Valueassert.active => 1 => 1assert.bail => 0 => 0assert.callback => no value => no valueassert.quiet_eval => 0 => 0assert.warning => 1 => 1auto_detect_line_endings => 0 => 0default_socket_timeout => 60 => 60safe_mode_allowed_env_vars => PHP_ => PHP_safe_mode_protected_env_vars => LD_LIBRARY_PATH => LD_LIBRARY_PATHurl_rewriter.tags => a=href,area=href,frame=src,form=,fieldset= => a=href,area=href,frame=src,form=,fieldset=user_agent => no value => no valueAdditional ModulesModule NameEnvironmentVariable => ValueTSLIB_TSDEVICE => /dev/input/touchscreen0USER => rootOLDPWD => /srv/wwwHOME => /home/rootPS1 => /u@/h:/w/$ LOGNAME => rootTERM => linuxPATH => /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:SHELL => /bin/shPWD => /srv/www/cgi-binTZ => UTCEDITOR => /bin/viPHP VariablesVariable => Value_SERVER["TSLIB_TSDEVICE"] => /dev/input/touchscreen0_SERVER["USER"] => root_SERVER["OLDPWD"] => /srv/www_SERVER["HOME"] => /home/root_SERVER["PS1"] => \u@\h:\w\$ _SERVER["LOGNAME"] => root_SERVER["TERM"] => linux_SERVER["PATH"] => /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:_SERVER["SHELL"] => /bin/sh_SERVER["PWD"] => /srv/www/cgi-bin_SERVER["TZ"] => UTC_SERVER["EDITOR"] => /bin/vi_SERVER["PHP_SELF"] => -_SERVER["SCRIPT_NAME"] => -_SERVER["SCRIPT_FILENAME"] => _SERVER["PATH_TRANSLATED"] => _SERVER["DOCUMENT_ROOT"] => _SERVER["REQUEST_TIME"] => 1267544129_SERVER["argv"] => Array( [0] => -)_SERVER["argc"] => 1_ENV["TSLIB_TSDEVICE"] => /dev/input/touchscreen0_ENV["USER"] => root_ENV["OLDPWD"] => /srv/www_ENV["HOME"] => /home/root_ENV["PS1"] => \u@\h:\w\$ _ENV["LOGNAME"] => root_ENV["TERM"] => linux_ENV["PATH"] => /usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:_ENV["SHELL"] => /bin/sh_ENV["PWD"] => /srv/www/cgi-bin_ENV["TZ"] => UTC_ENV["EDITOR"] => /bin/viPHP LicenseThis program is free software; you can redistribute it and/or modifyit under the terms of the PHP License as published by the PHP Groupand included in the distribution in the file: LICENSEThis program is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.If you did not receive a copy of the PHP license, or have anyquestions about PHP licensing, please contact [email protected].\[/code\]
 
Back
Top