[Xitami] CHMOD permissions
TW
xitami@lists.xitami.org
Sat, 31 Aug 2002 12:52:02 +0200
--=====================_4569700==_.ALT
Content-Type: text/plain; charset="us-ascii"; format=flowed
At 21:08 30.08.2002 +0200, you wrote:
>I run xitami on my computer to test perl/cgi and php/MySQL. How can I
>configure xitami to enable me to CHMOD files permissions? Any step by step
>help would be very much appreciated
>Chris
hi,
in my opinion this is none of a business to the webserver in use. It's the
business of your scripting language.
For example with php your tasks could be done like this:
<?
...
$myCommand = exec("chmod 777 myfile");
...
?>
Complete synopsis of exec is exec(string command, array output, integer
return), latter to params being optional and useful for debugging.
In perl its quiet similar.
Warning; Don't directly put user supplied data into command, escape it
appropriately first if necessary.
Of course, standard unix security applies, i.e. you can only change
permissions of files where the credentials/privileges of the user (php
process) and the respective file match (this is certainly the case for
files created via php).
If you try to run perl- or other shellscripts from within php and run into
troubles review the purpose of the safe_mode_exec_dir" and "safe_mode"
directives in php.ini and check your settings.
hope this serves as a starting point.
tony
--=====================_4569700==_.ALT
Content-Type: text/html; charset="us-ascii"
<html>
At 21:08 30.08.2002 +0200, you wrote:<br>
<blockquote type=cite class=cite cite><font face="arial" size=2>I run
xitami on my computer to test perl/cgi and php/MySQL. How can I configure
xitami to enable me to CHMOD files permissions? Any step by step help
would be very much appreciated</font><br>
<font face="arial" size=2>Chris</font></blockquote><br><br>
hi,<br><br>
in my opinion this is none of a business to the webserver in use. It's
the business of your scripting language.<br><br>
For example with php your tasks could be done like this:<br><br>
<?<br>
...<br>
$myCommand = exec("chmod 777 myfile");<br><br>
...<br>
?><br><br>
Complete synopsis of exec is exec(string command, array output, integer
return), latter to params being optional and useful for debugging.<br>
In perl its quiet similar.<br>
Warning; Don't directly put user supplied data into command, escape it
appropriately first if necessary.<br><br>
Of course, standard unix security applies, i.e. you can only change
permissions of files where the credentials/privileges of the user (php
process) and the respective file match (this is certainly the case
for files created via php).<br><br>
If you try to run perl- or other shellscripts from within php and run
into troubles review the purpose of the
<font face="Arial, Helvetica">safe_mode_exec_dir" and
"safe_mode" directives in php.ini and check</font> your
settings.<br><br>
hope this serves as a starting point.<br><br>
tony<br><br>
</html>
--=====================_4569700==_.ALT--