Php: how to create folders and why folders cannot be created _ PHP Tutorial

Source: Internet
Author: User
Php creates a folder and cannot create a folder. 1. how can I create a 0777 disk with the permission to set the directory? use the program to change the directory permission. use chmod 2, use ftp 3, and use the server permission, php Tutorial file creation 1. how can I create a 0777 disk with the permission to set the directory, use chmod to change the directory permissions with the program. use ftp. use server permissions,

Php Tutorial: creating folders and creating folders
To create a directory in php, we will use the mkdir () function to create a directory.
*/

$ Dir = "abc ";
If (mkdir ($ dir, 0777 ))
{
Echo 'directory '. $ dir. 'created successfully ';
}
Else
{
Echo 'failed to create directory. Please check authorization ';
}

/*

Mkdir function description
Mkdir (path, mode, recursive, context)
Path is required. The name of the created directory.
Mode is required. The default value is 0777.
Recursive is required. Set the recursive mode.
Context is required. Specifies the file handle environment.

Mkdir-related instances
Http://www.bkjia.com/phper/24/mkdir-05.htm


Unable to create folder cause analysis

1. how can I create a 0777 disk with the permission to set a directory? use chmod to change the directory permission in a program.
II. use ftp
3. it is better to use server permissions,

This is certainly the case when umask is 0777. you just need to manually use chmod to change it.

Chmod function description
Chmod (file, mode)

For example:

Chmod ("/somedir/somefile", 0755 );

Chmod instances
Http://www.bkjia.com/phper/24/chmod-php.htm
Http://www.bkjia.com/phper/24/ad7d09f46fce96a82f06fe711adeb47b.htm


Tutorial, php Tutorial to create a file...

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.