PHP upload files under linux considerations, _php Tutorial

Source: Internet
Author: User
Tags learn php learn php programming

PHP upload files under Linux considerations,


The example of this article for everyone to share the Linux php upload file notes, for your reference, the specific content as follows

1, modify the Upload directory permissions
Linux modifies all subdirectories permissions under a directory
Chmod-r 777 HTML
Modify a directory for any user with write read Execute permission
chmod a+rwx HTML
2. Set the root directory of the uploaded files
Get the project root directory
$siteRoot = DirName (__file__);
3, modify the configuration file upload size php.ini
Post_max_size = 200M
Upload_max_filesize = 200M
4, if you want to create a folder based on time and then upload files, you need the following

$AIMURL = Str_replace (', '/', $aimUrl), $aimDir = '; $arr = explode ('/', $AIMURL); foreach ($arr as $str) {$aimDir. = $str . '/'; if (!file_exists ($aimDir)) {mkdir ($aimDir); chmod ($aimDir, 0777);}}

The above is the whole content of this article, I hope that you learn PHP programming help.

http://www.bkjia.com/PHPjc/1135009.html www.bkjia.com true http://www.bkjia.com/PHPjc/1135009.html techarticle Linux under the PHP upload file considerations, this example for everyone to share the Linux php upload file notes, for your reference, specific content as follows 1, modify the upload directory permissions Linux repair ...

  • 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.