@gianmarcotoscano
There’s a few potential scenarios.
Permissions
If you’ve not already, check the permissions on your files and directories. Unless you’ve changed the user that Apache runs as, files and directories should be owned by the www-data
user.
From the CLI, you can run ls -al
on your home directory (where index.php
is) to see the user and the group that currently owns your files and directories.
If root
or another user owns anything there, you’ll most likely need to use chown
to change that.
For example, if your home directory is /var/www/html
(and ./html
is where index.php
is), we can run:
chown -R www-data:www-data /var/www/html
That sets all files and directories to be owned by www-data
.
Plugins
In some cases, some plugins simply don’t work as expected. If the above doesn’t work, disable all your plugins and try to upload a file. If it succeeds, re-enable plugins one-by-one until you’re not able to upload again. That’ll help identify which plugin is causing the issue.
Check the Logs
tail -20 /var/logs/apache2/error.log
The above command will dump the last 20 lines of the Apache error log to the CLI. If there’s a script error or something else going on during the attempt, it should get logged there and by looking over the errors, you may be able to identify something that isn’t immediately available when disabling and enabling plugins.
Restart Apache
If you made changes to php.ini
but didn’t restart Apache, the settings aren’t valid. Only once you restart Apache will those changes take effect.
service apache2 restart