Changes to the server time zone and upload file size limits in php.ini

Source: Internet
Author: User

1. Settings for Date.timezone

php5 default Date.timezone is UTC, Date.timezone = PRC To resolve a time difference of eight hours.

Modify the php.ini file to find the;d Ate.timezone =, remove the preceding semicolon and add the time zone after "=".
For example: Asia/chongqing (Chongqing), Asia/shanghai (Shanghai), Asia/urumqi (Urumqi), Asia/macao (Macau), Asia/hong_kong (Hong Kong), Asia/taipei (Taipei), PRC
Cases
;d Ate.timezone =
Change to:
Date.timezone = Asia/shanghai

2. Settings for uploading file size limits

Usually in the php.ini can set the maximum upload file size, and sometimes upload files can only be less than 512k? A little bit more error, unable to find the upload page, "the page cannot be displayed, ...., the server could not be found or a DNS error occurred."

PHP Upload File size limit workaround:

First: Check the following line in the php.ini:

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

Change these values to what I said, see if there is a problem, and also confirm that the uploaded <form> does not resemble the following line <input type= "hidden" name= "max_file_size" value= "500000" > This also restricts the upload size.

Second: If Apache 2 needs to be modified

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

In the Limitrequestbody 524288 will 524288 (=512x1024) to large, such as 5M (=5x1024x1024) so upload will not appear above problems, upload does not respond, upload the reality of the page can not be realistic will be resolved!

3. Notice of modifications to this type of configuration

Under XAMPP or WAMP, modifying the php.ini in wamp/bin/php may not take effect, because php.ini is placed under Apache/bin to modify the php.ini in it.

Changes to the server time zone and upload file size limits in php.ini

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.