Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:51487 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 94408 invoked from network); 20 Feb 2011 16:10:23 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 20 Feb 2011 16:10:23 -0000 X-Host-Fingerprint: 95.31.13.88 xdmitri2.static.corbina.ru Received: from [95.31.13.88] ([95.31.13.88:4631] helo=localhost.localdomain) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 30/5D-21930-DEC316D4 for ; Sun, 20 Feb 2011 11:10:22 -0500 Message-ID: <30.5D.21930.DEC316D4@pb1.pair.com> To: internals@lists.php.net References: Date: Sun, 20 Feb 2011 19:10:19 +0300 Lines: 25 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5994 X-RFC2646: Format=Flowed; Original X-Posted-By: 95.31.13.88 Subject: Re: PHP for embedded device: reduce size From: dmda@yandex.ru ("jvlad") > All, > > I have cross-compiled php-cgi for a MIPS device (mediaplayer), but the > binary is quite large, more than 3MB. I'm using: > > ./configure --prefix=../result/php-5.3.5 --host=i686-pc-linux-gnu > --target=mipsel-linux-gnu --build=mipsel-linux-gnu --enable-cgi > --disable-all --without-pear --with-config-file-path=/etc/ > > Which options do I have to reduce size of the binary? E.g. can I > remove the zend engine? you may want to re-generate zend_vm_execute.h php zend_vm_gen.php --without-specializer It will save ~300k. also you may want to try to remove Reflection, SPL and Date extensions and optimize for size: -O1 instead of performance (-O2) Don't forget to strip off debug info from the binary. regards, j