Jump to content

Cant create file


firestarapple

Recommended Posts

I have this problem. i use mkdir() to create a folder. after that, i use touch() to create a file but the file somehow cant be created. Why is it like this?

The folder has chmod 777, why cant i use touch to create a file in this

folder? how can i solve this problem in order to create the file?

Link to comment
https://forums.phpfreaks.com/topic/132555-cant-create-file/
Share on other sites

Post some code, post some error messages.

 

Also, what is your goal for creating this file? touch will attempt to create a file if it doesn't exist but that's not really it's primary purpose.  If you're trying to create a file and save stuff to it, use fopen, fwrite, fclose

Link to comment
https://forums.phpfreaks.com/topic/132555-cant-create-file/#findComment-689293
Share on other sites

now i realize the problem is the group permission and not the problem of creating file. i try to create file into other folders and file created successfully.and i check that the group of the file are different.

 

for example, i cant create file in folder 1 but i can create file in folder 2.both are different group file permission. how can i change the group permission?i have try use chown but fail. any other method using php to change the group permission?

Link to comment
https://forums.phpfreaks.com/topic/132555-cant-create-file/#findComment-692517
Share on other sites

i manage to change the group permission, but it seems that it  doesn't allow to create files in that new folder that i have created using mkdir. but if i login to ftp and manually create folder, new file can be created in this folder(the one i created manually when i login ftp). why is it like this?

 

both folders contain same group permission and same chmod but why it allows to create file in that folder that i manually create when i login into FTP but not in that folder that i created using script (mkdir)?

 

how to solve?

 

Link to comment
https://forums.phpfreaks.com/topic/132555-cant-create-file/#findComment-693160
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.