From nobody Tue Mar 1 16:47:05 2022 X-Original-To: freebsd-questions@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 5B1D019F930B for ; Tue, 1 Mar 2022 16:47:20 +0000 (UTC) (envelope-from gobble.wa@gmail.com) Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1D4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4K7NT31yQVz4Rpq for ; Tue, 1 Mar 2022 16:47:19 +0000 (UTC) (envelope-from gobble.wa@gmail.com) Received: by mail-ed1-x52e.google.com with SMTP id w3so22781109edu.8 for ; Tue, 01 Mar 2022 08:47:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :content-transfer-encoding; bh=fPif1ZIznRG3AuwI9MN0jOsP7mlzeJKGC9TR8w1RwJk=; b=c0VvX5zQSNxLkHxuXn0sRA4Dh1GFJ7AScVb0e+lb0ijb8rqcIUvjwtwjU9h34HbAHW B+5s4t09TTz7uZEwCFZCK6MZYyqSah1AuC0b0JDm3pa5uqNuNRZNM1qvSzEclu8q008o L0rSrw/CDTW1mv8YEltIwMJDkgoejJUYoegz+x7ZU/1KJbujVLtgRfcXV0He0vUnNgnx Yxgpuxz4R2l6WeVXGdPM4HvcpqDZOIHp0qYJKk0BKZLl8WxSuI8fJEuewwWJ9wt/Ok4Z us/ixqGrfyN11okeM35jadq9hsuEoeECVGb8zR4WEMZEm9aLq9xrupRqFeWj4eB4LEXO pzyA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:content-transfer-encoding; bh=fPif1ZIznRG3AuwI9MN0jOsP7mlzeJKGC9TR8w1RwJk=; b=nL1FvTnmlld7RLCusA89gN6Fw/wtYDVa8m+py0uwGroba+E+RKIDl3qVXap/OtzInQ u9H4QGB8qDa9F2ANRnvPpZz+dNb7rH0AqYN1sbya72VwRNzysAhy/hnxH4F4Dl6K6GPX +ynA40WKZEVNRcpCflN8vUQFAOYesFd+8YWFmgo7lzIbaDaEZL5rTvsZcKmN8DnQYt3I fv0AxhtgdnY9zoWBymPwe47CRM/EiOxOwIr/L4yD5HNgWfYPba7qAFqzogJs4HKhUTFh BNRBo7n546FLAg72C5A8fq6xe+VkbjSO/l05TPCfbCaL9N8ZUCI48pF+YWNQsFy8iTO1 g2+w== X-Gm-Message-State: AOAM531G/C/BDI6wgAA9OwnnZ2YT0RxNcw2Qbxs5X4djialm2Wh/Y+cF UmQZG4q5rVoV/7YO6A49Z2dPOSFgtU7m/9pVejxAR0DQiDZ+Ag== X-Google-Smtp-Source: ABdhPJziYZP7+uAei1/1ZKunVZT9iwYOfzxMjBbEEBrk5OOxriyYEb5sHQN6RSz86uOg1tpbfo+KHjdZDG4V1AZcogs= X-Received: by 2002:a05:6402:183:b0:410:fde:887a with SMTP id r3-20020a056402018300b004100fde887amr25136197edv.243.1646153237507; Tue, 01 Mar 2022 08:47:17 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-questions@freebsd.org X-BeenThere: freebsd-questions@freebsd.org MIME-Version: 1.0 References: <637715396.61990484.1646149769165.JavaMail.zimbra@shaw.ca> In-Reply-To: From: Waitman Gobble Date: Tue, 1 Mar 2022 16:47:05 +0000 Message-ID: Subject: Re: file upload issues with SuiteCRM V7/8 (or apache24 and php8 diff FreeBSD vs Debian) To: freebsd-questions Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Rspamd-Queue-Id: 4K7NT31yQVz4Rpq X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20210112 header.b=c0VvX5zQ; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gobblewa@gmail.com designates 2a00:1450:4864:20::52e as permitted sender) smtp.mailfrom=gobblewa@gmail.com X-Spamd-Result: default: False [-3.98 / 15.00]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; FREEMAIL_FROM(0.00)[gmail.com]; MID_RHS_MATCH_FROMTLD(0.00)[]; TO_DN_ALL(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; TAGGED_FROM(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.98)[-0.984]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20210112]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::52e:from]; MLMMJ_DEST(0.00)[freebsd-questions]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[] X-ThisMailContainsUnwantedMimeParts: N On Tue, Mar 1, 2022 at 4:45 PM Waitman Gobble wrote: > > On Tue, Mar 1, 2022 at 3:50 PM Dale Scott wrote: > > > > Is anyone using SuiteCRM on FreeBSD, and if so, did you have to do anyt= hing beyond following the installation instructions? > > > > I have tested both SuiteCRM V7 and V8 on FreeBSD V13 using Apache 2.4 a= nd PHP 8.0, and get errors accessing uploaded files. The files are uploaded= and end up in the .../suitecrm/uploads/ directory, but they cannot be acce= ssed after uploading. The simplest example is uploading a profile photo (80= 0x944 JPG). After uploading, the image doesn't get rendered in the profile = page and there's a PHP Fatal error in httpd-error.log. With the exception o= f uploaded files, SuiteCRM _appears_ to work correctly otherwise. > > > > There is discussion in the SuiteCRM forum regarding the same symptoms, = but the solutions are to set file and directory permissions correctly (file= not uploading at all) and/or load the php fileinfo module (file mime type = not recognised correctly), both of which I have confirmed are correct (even= chmod -R 777 for testing, and fileinfo was already enabled and confirmed b= y phpinfo). I'm not familiar with MIME types and implications, but verified= mime_module was enabled in httpd.conf (and even tried enabling mime_magic_= module, to no effect). > > > > I haven't tried spinning up an Ubuntu vm to positively confirm for myse= lf, but so far as I can tell Linux users are successfully using SuiteCRM on= standard Linux AMP stacks, encountering only trivial errors during install= ation. If I do get try installing on Ubuntu, comparing Apache and PHP confi= g (and build options) feels like searching for a needle in a haystack, and = possibly a black hole of learning Linuxisms. Any suggestions? > > > > > > Fwiw, here is the PHP Fatal error that occurs after saving a profile pi= cture (I presume when the page is rendered with the new image): > > > > [Tue Mar 01 08:13:13.132076 2022] [php:error] [pid 49638] [client 174.0= .43.39:45460] PHP Fatal error: Uncaught TypeError: in_array(): Argument #2= ($haystack) must be of type array, null given in /usr/local/www/SuiteCRM-7= .12.4/download.php:267\nStack trace:\n#0 /usr/local/www/SuiteCRM-7.12.4/dow= nload.php(267): in_array()\n#1 /usr/local/www/SuiteCRM-7.12.4/include/MVC/C= ontroller/SugarController.php(1017): require_once('...')\n#2 /usr/local/www= /SuiteCRM-7.12.4/include/MVC/Controller/SugarController.php(465): SugarCont= roller->handleEntryPoint()\n#3 /usr/local/www/SuiteCRM-7.12.4/include/MVC/C= ontroller/SugarController.php(361): SugarController->process()\n#4 /usr/loc= al/www/SuiteCRM-7.12.4/include/MVC/SugarApplication.php(101): SugarControll= er->execute()\n#5 /usr/local/www/SuiteCRM-7.12.4/index.php(52): SugarApplic= ation->execute()\n#6 {main}\n thrown in /usr/local/www/SuiteCRM-7.12.4/dow= nload.php on line 267, referer: https://suitecrm.dalescott.net/index.php?mo= dule=3DUsers&action=3DDetailView&record=3D1 > > dale@whizzer:/usr/local/etc/php % > > > > and this is the offending line 267 in download.php > > > > if (in_array($row['file_ext'], $sugar_config['allowed_preview'], true))= { > > $showPreview =3D isset($_REQUEST['preview']) && $_REQUEST['preview'= ] =3D=3D=3D 'yes' && $mime_type !=3D=3D 'text/html'; > > } > > > > > > Best regards, and TIA :-) > > > > Dale > > > > > > --- > > Dale Scott > > www.dalescott.net > > https://ca.linkedin.com/in/dalescott > > > > There's no result from (i presume) db query . > > $row['file_ext'] is null. > > $row is typically used for a db result, but i haven't looked at the code. > Code execution probably should make it to this block if there's no > query result. > > I'll check out SugarCRM I don't think i've tried this one. > > > > > -- > Waitman Gobble oops, "Code execution probably *should not* make it to this block..." --=20 Waitman Gobble