dweimer
dweimer

I am trying to test out October CMS, I have it installed, the dashboard shows that the system is up to date, and no warnings to display. However within the assets section of the CMS and the Media section I am unable to upload any files. I am trying a simple 218K JPEG image as a test. I haven't modified the PHP max upload, phpinfo() states that is set at the default 2M, so it shouldn't be a size issue. I simply receive the error message "Error uploading file 'background.jpg': File is not valid". I haven't been able to find an error in any of the Apache logs, the PHP-FPM log or in any of the event logs within October. I am kind of at a loss as to where to troubleshoot whats going on. I started looking through the code following the error message but found it a little hard to follow the classes as one class called another, I am sure with enough digging I may get to an actual function but I thought someone might already know a better place to start.

System is running on FreeBSD with Apache 2.4.23, PHP 7.0.8 using php-fpm, with PostgreSQL 9.5.3 as the backend DB on a separate server.

Eoler
Eoler

dweimer said: I simply receive the error message "Error uploading file 'background.jpg': File is not valid".

Just guessing: do you have FileInfo PHP extension installed?

dweimer
dweimer

Yes, I put together a simple test.

<?php
echo "<pre>";
echo mime_content_type('background.jpg') ;
echo "\n";
echo mime_content_type('fileinfo.php');
echo "\n";
$FileInfo = finfo_open(FILEINFO_MIME,'/usr/local/etc/apache24/magic');
echo finfo_file($FileInfo, 'background.jpg');
echo "\n";
echo finfo_file($FileInfo, 'fileinfo.php');
echo "</pre>";
?>

Results:

image/jpeg
text/x-php
application/octet-stream; charset=binary
text/plain; charset=us-ascii
dweimer
dweimer

Found it, I tried uploading a custom logo on the CMS backend settings, and received a different error, "File missing from request".

That led me to this thread

After some investigation, and trial and error, setting the upload_tmp_dir in php.ini solved it.

administrator57283
administrator57283

on CyberPanel I fixed it by following steps:

  1. Added made sure PHP version I am using is the same for what is for my website, i.e. 7.3
  2. Turned on file_uploads "ON" (Most important) (this is where everything started working good)
  3. Adding upload_tmp_dir dir might work but for me turning on only file_uploads worked
  4. Added /tmp directory to OpenLiteSpeed > Server Configuration > File Uploads

Last updated

1-5 of 5