Date: Tue, 1 Mar 2022 16:47:05 +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_fxjM5Dsy4DGgJtZwneW9SgZM8dHt8uX3KivWKxdgRdCxw@mail.gmail.com> In-Reply-To: <CAFuo_fzAyeDBvr0UbjJUqQii1ygePUMY-7FM93vCZZYb2S40DQ@mail.gmail.com> References: <637715396.61990484.1646149769165.JavaMail.zimbra@shaw.ca> <CAFuo_fzAyeDBvr0UbjJUqQii1ygePUMY-7FM93vCZZYb2S40DQ@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, Mar 1, 2022 at 4:45 PM Waitman Gobble <gobble.wa@gmail.com> wrote: > > 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 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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAFuo_fxjM5Dsy4DGgJtZwneW9SgZM8dHt8uX3KivWKxdgRdCxw>