Create a folder and file test in php in linux. php file: $ dir = & quot ;. /OK/& quot; $ result = mkdir ($ dir, 0777); echo $ result; I wrote this code to create a folder... it is possible in the window .. but it won't work in linux .. l create folders and files in php in linux
Test. php file:
$ Dir = "./OK /";
$ Result = mkdir ($ dir, 0777 );
Echo $ result;
I wrote such a piece of code to create a folder... it works in the window ..
But it won't work in linux ..
The linux environment is good. other products can be supported.
And I have 0777 permission for the test. php file ....
But it still fails to be created... and no error is reported... it is blank.
------ Solution --------------------
Do all the parent folders of the file you created have the write permission ???
------ Solution --------------------
In theory, it should be okay. But I have never tried Linux
PHP code
$ Dir = dirname (_ FILE _). "./OK ";
Echo mkdir ($ dir, 0777 )? 'OK': 'failed ';
Open the directory and check whether the directory has been created ~
------ Solution --------------------
This has nothing to do with whether the test. php is 777.
The problem is whether your apache permissions have the write and execution permissions on the current folder.
We recommend that you set the current folder to 777 and try your code again.
Of course, if a folder with the same name already exists, the creation will fail.
------ Solution --------------------
You must have the permission to create the php file of the folder...
Check whether apache has the creation permission.