php file upload not working on server

preview_player
Показать описание
check if php is installed:
php -v
if not:
sudo apt-get install php8.1
or : sudo apt-get install php8.1*
or: sudo apt-get install -y php8.1-cli php8.1-common php8.1-mysql php8.1-zip php8.1-gd php8.1-mbstring php8.1-curl php8.1-xml php8.1-bcmath

edit:
uncomment:
file_upload=no
file_max_filesize=100M
max_file_uploads= 200

Make sure your php file upload script contains the correct upload folder directory:

./upload/ or /upload , upload/

Check if the upload folder has the required permission:
""normally all files on a server must have the following permission: 644 and all folders 755""
sudo chmod 755 -R your-upload-folder
if not. try with chmod 777

sudo chown username:usergroup your-upload-folder

restart your server.
apache:
sudo service apache2 restart

nginx:
sudo systemctl restart nginx
Рекомендации по теме
Комментарии
Автор

Thank you so much, I just completed my task after watching your video

quan.pv
Автор

Thanks man u r great, I did in kali linux

kritaghyamishra
Автор

Hello, I need to point where my files are going to a different folder in php on my Ubuntu server. Can you help me out please?

DiyintheGhetto
Автор

you have to add the user apache to group apache

msf