Jump to content

Create file on server using php


siddscool19

Recommended Posts

fopen() should work if you have the correct permissions set on the directory and specify the correct mode parameter.

 

If using linux you could issue a system command with exec() (if your host allows this)

exec("touch myfile.txt")

The only reason fopen() wouldn't be able to create file is if:

 

- The directory you are attempting to write to isn't writable.

- The file you are attempting to write to isn't writable and/or has a different owner without the world-writable flag set

- fopen() is disabled in php.ini

 

What error are you getting? The error is pretty painfully verbose.

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.