From owner-freebsd-hackers@freebsd.org Fri Mar 18 07:33:23 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B935FAD4710 for ; Fri, 18 Mar 2016 07:33:23 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from mail.infocus-llc.com (mail.infocus-llc.com [199.15.120.13]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 9AB331E17 for ; Fri, 18 Mar 2016 07:33:23 +0000 (UTC) (envelope-from fullermd@over-yonder.net) Received: from draco.over-yonder.net (c-75-65-60-66.hsd1.ms.comcast.net [75.65.60.66]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.tarragon.infocus-llc.com (Postfix) with ESMTPSA id 3qRH584dQXz4f; Fri, 18 Mar 2016 02:33:16 -0500 (CDT) Received: by draco.over-yonder.net (Postfix, from userid 100) id 3qRH575mBlz2L1; Fri, 18 Mar 2016 02:33:15 -0500 (CDT) Date: Fri, 18 Mar 2016 02:33:15 -0500 From: "Matthew D. Fuller" To: Yao Bao Cc: freebsd-hackers@freebsd.org Subject: Re: Strange php shell_exec() issue. Message-ID: <20160318073315.GC4672@over-yonder.net> References: <201603180709.u2I79T2i005577@reorigin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <201603180709.u2I79T2i005577@reorigin.com> X-Editor: vi X-OS: FreeBSD X-Virus-Scanned: clamav-milter 0.99 at mail.tarragon.infocus-llc.com X-Virus-Status: Clean User-Agent: Mutt/1.5.24-fullermd.4 (2015-08-30) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 18 Mar 2016 07:33:23 -0000 On Fri, Mar 18, 2016 at 03:09:29AM -0400 I heard the voice of Yao Bao, and lo! it spake thus: > > I execute the command via shell and php CLI, both return the same > right result. But the problem is, when I try to echo the result on > browser, the number field of the output doubled! Perhaps you've got $BLOCKSIZE=1024 in your env, so when you run it from your shell (or a descendent thereof), it's showing the output in multiples of 1k, but from the web there's no such env, so you're showing in multiples of 512. Try with du -k (or -h, if it's for human consumption anyway). -- Matthew Fuller (MF4839) | fullermd@over-yonder.net Systems/Network Administrator | http://www.over-yonder.net/~fullermd/ On the Internet, nobody can hear you scream.