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.
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?
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>"; ?>
image/jpeg text/x-php application/octet-stream; charset=binary text/plain; charset=us-ascii
on CyberPanel I fixed it by following steps:
- Added made sure PHP version I am using is the same for what is for my website, i.e. 7.3
- Turned on file_uploads "ON" (Most important) (this is where everything started working good)
- Adding upload_tmp_dir dir might work but for me turning on only file_uploads worked
- Added /tmp directory to OpenLiteSpeed > Server Configuration > File Uploads
1-5 of 5