I am using Laravel 8 with livewire and trying to upload image in hosting Linux server giving me error. But in Localhost happening properly no error occur.
2 Answers
As the error message says, tmpfile() is disable on the linux server for security reasons. You don't see this error on your local server because tmpfile() is not disabled there.
You can check which functions are disabled by using:
var_dump(ini_get('disable_functions'));
or open the php.ini file and look for:
# list of function to disable globally #
disable_functions=tmpfile
Comments
To someone who using Cloudways(Digital Ocean) and don't know where to fix it on, please have a look on PHP FPM Settings and search for tmpfile.
Remove tmpfile on the php_admin_value[disable_functions] list.
Full docs here: https://support.cloudways.com/en/articles/7891624-how-to-enable-php-functions
