Notes for uploading files in php in linux: _ PHP Tutorial

Source: Internet
Author: User
Tags learn php programming php file upload
Notes for uploading files in php in linux ,. Notes for uploading files in php in linux. the example in this article shares the precautions for uploading files in php in linux for your reference, the specific content is as follows: 1. modify the upload directory permission linux notes for php file uploading in linux,

This article provides examples of considerations for uploading files in php in linux for your reference. the specific content is as follows:

1. modify the upload directory permission
Linux modifies all subdirectories in a directory
Chmod-R 777 html
Modify a directory to Grant write-read-write permission to any user.
Chmod a + rwx html
2. set the root directory of the uploaded file
// Obtain the Project root directory
$ SiteRoot = dirname (_ file __);
3. modify the configuration file upload size. php. ini
Post_max_size = 200 M
Upload_max_filesize = 200 M
4. if you want to create a folder based on the time and then upload the file, you need:

$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 all the content of this article. I hope it will help you learn php programming.

Examples in this article share with you the notes for php file upload in linux for your reference. The details are as follows: 1. modify the upload directory permission for linux...

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.