Quantcast
Channel: Active questions tagged ubuntu - Stack Overflow
Viewing all articles
Browse latest Browse all 5956

Upload PHP Script not working in Ubuntu server, but works in development environment

$
0
0

I have a form which you choose a file (a image) through an input type file and it must upload that image to a folder.On my Computer (Running XAMPP) that works fine, but now I'm moving the project to my server because it's finished.

My server runs Ubuntu 16.04 (Apache + PHP + MySQL).
Apache Version: Apache/2.4.18 (Ubuntu)
PHP Version: 7.0.4-7ubuntu2.1
MySQL Version: 5.7.12-0ubuntu1 - (Ubuntu)

What I've tried:-Give max permissions to the both files (the form file and the file where the post action is)

Upload Script:

<?php$File = array("Name" => $_FILES['prod_image']['name'], "Error" => $_FILES['prod_image']['error'], "Size" => $_FILES['prod_image']['size'], "tmp_name" => $_FILES['prod_image']['tmp_name']);move_uploaded_file($File['tmp_name'], "../images/".basename($File['Name']));

Viewing all articles
Browse latest Browse all 5956

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>