Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1009275
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T08:53:59+00:00 2026-05-16T08:53:59+00:00

I am having a strange problem while uploading large files in PHP. In php.ini,

  • 0

I am having a strange problem while uploading large files in PHP.

In php.ini, max_execution_time is set to 30, post_max_size is set to 32M, upload_max_filesize is set to 32M. When I tried to upload a file of size 40.2 MB, it don’t show any error. The $_FILES variable has the value array(0) { } and $_FILES['userfile'] shows NULL.

If the file size is more than the value set in php.ini, then it should return the error message

UPLOAD_ERR_INI_SIZE, Value: 1; The uploaded file exceeds the upload_max_filesize directive in php.ini.

But it’s not showing any error either (as $_FILES is an empty array). I am clueless why this is happening.

When I change in php.ini and set post_max_size is set to 64M, upload_max_filesize is set to 64M, then it works fine. So, I decided to use the following code, instead of changing php.ini file.

ini_set('upload_max_filesize', '64M');
ini_set('post_max_size', '64M');
ini_set('max_execution_time', 300);

I even tried to increase max_execution_time. Still, I am having the same problem. ini_set() is not working here.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T08:54:00+00:00Added an answer on May 16, 2026 at 8:54 am

    To have the 40 MB file fail with upload error, you have to increase the post_max_size, if you exceed the value of that variable, you get an empty $_FILES array. See the manual

    If the size of post data is greater
    than post_max_size, the $_POST and
    $_FILES superglobals are empty.

    Also, ini_set() is not working there because two of the variables you are trying to change are PHP_INI_PERDIR and thus need to be changed in php.ini or in .htaccess or httpd.conf. You should try the 40MB file with, for example, these settings in .htaccess

    php_value upload_max_filesize 32M
    php_value post_max_size 64M
    php_value max_execution_time 300
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 502k
  • Answers 502k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Note that the shell is not part of the public… May 16, 2026 at 2:42 pm
  • Editorial Team
    Editorial Team added an answer There is no way to prevent extending an interface. You… May 16, 2026 at 2:42 pm
  • Editorial Team
    Editorial Team added an answer Internet Explorer 7 doesn't do so well, but IE8 does.… May 16, 2026 at 2:42 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I'm having a strange problem while attempting to transform a blocking socket server into
I am having a strange problem while returning a string. it says can not
I am having a strange problem. I have a function which returns a large
i'm having some really strange problem. i wrote a filemanager in PHP with the
I am facing this strange problem while working with Generic Base Classes. I am
I'm having a strange problem and haven't been able to find anything about it
I am having a rather strange problem, I deployed 2 .NET applications on my
This is a strange problem that I am having with WCF trying to send
i'm running into a strange problem in Microsoft SQL Server 2008. I have a
I have a strange 'problem' with one of my created queries. Given the next

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.