Jump to content

disable_functions doesn't work?


Recommended Posts

I have a virtualhost with disable_functions defined as:

<VirtualHost x.x.x.x>

php_admin_value disable_functions system,passthru,exec,popen,proc_close,proc_open,shell_exec

</VirtualHost>

 

But this PHP code still works:

<html>

<?

$sCMD = `/bin/cat /tmp/test.txt`;

echo $sCMD;

?>

</html>

 

The contents of test.txt is still read and echoed out. Am I missing something?

 

I'm running PHP 5.3.16 on Linux 2.4.

Link to comment
Share on other sites

disable_functions string

This directive allows you to disable certain functions for security reasons. It takes on a comma-delimited list of function names. disable_functions is not affected by Safe Mode.

 

Only internal functions can be disabled using this directive. User-defined functions are unaffected.

 

This directive must be set in php.ini For example, you cannot set this in httpd.conf.

 

Link to comment
Share on other sites

This directive must be set in php.ini For example, you cannot set this in httpd.conf.

 

Thanks. I should read more. But this means its server wide, I cannot disable some functions for some Virtualhosts and not others correct? Doesn't that make it unrealistic?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.