File upload problem on my server

I am trying to upload a file using php. I am using move_uploaded_file function. However, it works fine on my local machine, but when I test it on the server, it doesn't work. How can I find out what is missing on my server.

Thanks in advance.

+1


a source to share


4 answers


  • file_uploads

    should be On .
  • You must not exceed the size of the upload_max_filesize

    uploaded file.
  • You must not exceed the post_max_size

    data you submit.
  • You must not exceed max_input_time

    .
  • Make sure the user using apache has permission to write files to the target directory.


Check if these variables are in sync php.ini

with your local server or if you don't have access to the target server settings, make your local ones the same and work on it.

+4


a source


whenever you run into problems in PHP, I suggest checking the web server log files. in this situation I think it might be PHP configurations. check your PHP settings and make sure file uploads are allowed on the web server. PHP configurations are stored in the php.ini file. to find out more information, create a simple php file, say info.php and enter the following lines into it:

<?php
    phpinfo();
?>

      



upload info.php file to your server and open the page in your web browser. try looking for "file_uploads". it should be "on". if it is disabled, find the php.ini file and change the "file_uploads" value to "on".

+2


a source


Check the output of php_info () to see if the server allows file uploads - property 'file_uploads'. If not, it must be configured to resolve it.

0


a source


I have a download issue where it will download files, but it hasn't given the files any permissions, so if you try to open them from the browser, it shows up as they aren't there. You can check if this has happened.

0


a source







All Articles