Jump to content

Checking File Permissions (PHP Software Installer)

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
3 replies to this topic

#1
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
Hey guy's.

I'm currently developing a Bug Tracking system in PHP, I'm currently in the process of developing the installation system, I have everything else working such as creating the connection file for the SQL database, and inserting the data and tables to the SQL, but id like it to check the file permissions of directory's and files to check there writable (CHMOD 777)

Does anybody know the code to get this working?

Thank's guys :D.

#2
webcodez

webcodez

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
Have a look at the use of the function fileperms() : PHP: fileperms - Manual .

#3
Bioshox

Bioshox

    Programming Professional

  • Members
  • PipPipPipPipPip
  • 207 posts
Welcome back WebCodez, long time no speak!

And unfortunalty, I don't really understand the PHP Manuals ):

#4
webcodez

webcodez

    Programmer

  • Members
  • PipPipPipPip
  • 149 posts
Hi there,

Thank you =]

And, I see, re-read your message and I think just using the function is_writable would do the job, like:

$filename = "test.php";
 
if(is_writeable($filename)) {
   echo "File {$filename} is writeable.";
}else{
   echo "File {$filename} is not writeable (No permissions).";
}