Google Groups Home
Help | Sign in
chmod and php
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
rojas....@gmail.com  
View profile
 More options Dec 31 2007, 10:39 am
From: rojas....@gmail.com
Date: Mon, 31 Dec 2007 07:39:07 -0800 (PST)
Local: Mon, Dec 31 2007 10:39 am
Subject: chmod and php
The chmod command (abbreviation of change mode) is a unix command that
will allow to change permissions of a file. This is a very useful when
working with OSCommerce and any application that writes the
configuration files. For security reason you will want to change the
permission to read only.

PHP will allow you to perform this with the native chmod() function.
This function requires 2 parameters to work. The file to change and
the mode (permission).

chmod(string $filename, int $mode)

Lets make a real example here. You want to change the mode to read
only on configuration.php

<?php

chmod('/home/~user/public_html/configuration.php', 0444);

?>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Will  
View profile
 More options Jan 2, 9:42 am
From: Will <jazze...@gmail.com>
Date: Wed, 2 Jan 2008 06:42:12 -0800 (PST)
Local: Wed, Jan 2 2008 9:42 am
Subject: Re: chmod and php
It is important to note that when entering the $mode, it must be a 4-
digit octal number starting with a 0, unlike the Unix version which is
only three digits.

On Dec 31 2007, 10:39 am, rojas....@gmail.com wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google