Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Mar 2022 16:45:30 +0000
From:      Waitman Gobble <gobble.wa@gmail.com>
To:        freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: file upload issues with SuiteCRM V7/8 (or apache24 and php8 diff FreeBSD vs Debian)
Message-ID:  <CAFuo_fzAyeDBvr0UbjJUqQii1ygePUMY-7FM93vCZZYb2S40DQ@mail.gmail.com>
In-Reply-To: <637715396.61990484.1646149769165.JavaMail.zimbra@shaw.ca>
References:  <637715396.61990484.1646149769165.JavaMail.zimbra@shaw.ca>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 1, 2022 at 3:50 PM Dale Scott <dalescott@shaw.ca> wrote:
>
> Is anyone using SuiteCRM on FreeBSD, and if so, did you have to do anythi=
ng beyond following the installation instructions?
>
> I have tested both SuiteCRM V7 and V8 on FreeBSD V13 using Apache 2.4 and=
 PHP 8.0, and get errors accessing uploaded files. The files are uploaded a=
nd end up in the .../suitecrm/uploads/ directory, but they cannot be access=
ed after uploading. The simplest example is uploading a profile photo (800x=
944 JPG). After uploading, the image doesn't get rendered in the profile pa=
ge and there's a PHP Fatal error in httpd-error.log. With the exception of =
uploaded files, SuiteCRM _appears_ to work correctly otherwise.
>
> There is discussion in the SuiteCRM forum regarding the same symptoms, bu=
t the solutions are to set file and directory permissions correctly (file n=
ot uploading at all) and/or load the php fileinfo module (file mime type no=
t recognised correctly), both of which I have confirmed are correct (even c=
hmod -R 777 for testing, and fileinfo was already enabled and confirmed by =
phpinfo). I'm not familiar with MIME types and implications, but verified m=
ime_module was enabled in httpd.conf (and even tried enabling mime_magic_mo=
dule, to no effect).
>
> I haven't tried spinning up an Ubuntu vm to positively confirm for myself=
, but so far as I can tell Linux users are successfully using SuiteCRM on s=
tandard Linux AMP stacks, encountering only trivial errors during installat=
ion. If I do get try installing on Ubuntu, comparing Apache and PHP config =
(and build options) feels like searching for a needle in a haystack, and po=
ssibly a black hole of learning Linuxisms. Any suggestions?
>
>
> Fwiw, here is the PHP Fatal error that occurs after saving a profile pict=
ure (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.4=
3.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.1=
2.4/download.php:267\nStack trace:\n#0 /usr/local/www/SuiteCRM-7.12.4/downl=
oad.php(267): in_array()\n#1 /usr/local/www/SuiteCRM-7.12.4/include/MVC/Con=
troller/SugarController.php(1017): require_once('...')\n#2 /usr/local/www/S=
uiteCRM-7.12.4/include/MVC/Controller/SugarController.php(465): SugarContro=
ller->handleEntryPoint()\n#3 /usr/local/www/SuiteCRM-7.12.4/include/MVC/Con=
troller/SugarController.php(361): SugarController->process()\n#4 /usr/local=
/www/SuiteCRM-7.12.4/include/MVC/SugarApplication.php(101): SugarController=
->execute()\n#5 /usr/local/www/SuiteCRM-7.12.4/index.php(52): SugarApplicat=
ion->execute()\n#6 {main}\n  thrown in /usr/local/www/SuiteCRM-7.12.4/downl=
oad.php on line 267, referer: https://suitecrm.dalescott.net/index.php?modu=
le=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.




--=20
Waitman Gobble



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFuo_fzAyeDBvr0UbjJUqQii1ygePUMY-7FM93vCZZYb2S40DQ>