QUOTE (DS2K3 @ Aug 18 2005, 02:54 AM)
If you do go the PHP route, then safe_mode is not strictly necessary, provided that PHP/Apache have their own user/group and arent run as root. I have never used a hosting company that turned safe_mode on.
Keep in mind that if Apche/PHP DOES hasve it's own group, that group must have permission to use the commands/files that you specify in the PHP script, otherwise you will get an error and nothing good will happen.
passthru() and the proc_open() commans might also be useful, but it depends on what you want to do with the output fom the commands.
D
I'll assume three things.
1) Apache is run as 'apache', or 'nobody'
2) Safe_mode is not turned on
3) Apache can view the contents of a users directory (or even worse, CHANGE the contents of a users directory), atleast public_html (assuming you're letting users have personal websites, which apache will probably allow by default)
Excellent, now a malicous user can view files that were only hidden from users, as well as view (and possibly edit) the contents of other people's home directories.

Safe_mode + php_admin_value open_basedir /home/user (in apache virtual host settings) is the only way I've seen to stop this from happening. I could be wrong though. *shrugs*
This is especially bad if
QUOTE
<?php
echo exec('ls /usr/local/apache2/htdocs');
echo exec('cat /usr/local/apache2/htdocs/safe.php');
echo exec('cat /usr/local/apache2/conf/httpd.conf');
echo exec('ls /home');
echo exec('cat /home/otherguy/public_html/safe.php');
?>
I might just be paranoid though. <.<