Two PHP file size restrictions _ PHP Tutorial

Source: Internet
Author: User
Tags netcraft php file upload
Two PHP file size limit solutions. PHP is still quite commonly used, so I studied the limit on the size of PHP files to be uploaded. here I will share with you the solution to the limit on the size of PHP files to be uploaded, I hope PHP is still quite common for everyone. so I studied the PHP file upload size limit. here I will share with you the PHP file upload size limit solution, I hope it will be useful to you. PHP itself is a simple and powerful language. PHP has core features such as powerful string and array processing capabilities, and greatly improved support for object-oriented programming (PHP5 and later versions ). Using standard and optional extension modules, PHP applications can connect to more than a dozen databases such as MySQL or Oracle, draw, create PDF files, and create parsed XML files.

You can also use the C language to write your own PHP extension module. For example, provide a PHP interface function in an existing code library. You can also run PHP in Windows, use COM to control other Windows applications such as Word and Excel, or use ODBC to connect to the database.

In China, PHP is a commonly used network programming language. ASP3.0 has already been abandoned by Microsoft and will not be updated any more. some people may think that PHP should also be something that will soon become a new thing, right? However, on the contrary, PHP is not only developing rapidly, but also leaving ASP far behind. it is gradually becoming the most widely used and popular language on the Internet.

  • Http://www.netcraft.com), now the world's use of PHP web site servers more than 23 million (the world's top 1/4, the number of global sites including all of the static network site around 0.1 billion ). According to Netcraft data, PHP has developed rapidly this year, and the growth momentum is strong. According to the world's most popular programming language rankings tibench (http://www.tiobe.com/tpci.htm), PHP ranked top five. Generally, you can set the maximum size of the uploaded file in php. ini. sometimes the size of the uploaded file must be smaller than KB? An error occurs when the page is slightly larger. the upload page cannot be found. "this page cannot be displayed." no server is found or a DNS error occurs.

    PHP file size limit solution:

    First, check the following lines in php. ini:

       
       
    1. upload_max_filesize = 8M
    2. post_max_size = 10M
    3. memory_limit = 20M

    Change these values to what I said to see if there are any problems. Also, confirm the uploaded

    There is no line similar to the following This also limits the upload size.

    Second, if apache 2 needs to be modified

        
       
    1. /etc/httpd/conf.d/php.conf

    The LimitRequestBody 524288 in will increase 524288 (= 512x1024), such as 5 M (= 5x1024x1024), so that the upload will not encounter the above problem, the upload will not respond, this page cannot be uploaded and will be resolved!


    ...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.