4

I was wondering if there was a method of editing disable_functions (so as to enable the exec() function) by using PHP code, or just in a way that won't involve access to the php.ini file? If so, what would that be?

1
  • You might be able to use per-directory ini files, depending on your version of PHP. I don't know if this will allow you to override the disable_functions() list though; the googles seem to suggest you can except for exec(). (left as comment as I don't know if this will actually help) Commented Jul 26, 2011 at 22:56

2 Answers 2

6

I was wondering if there was a method of editing disable_functions (so as to enable the exec() function) by using PHP code,

No, because that would make disable_functions completely useless: Its there for security reason, but where is the security, when everybody can change it?

or just in a way that won't involve access to the php.ini file?

Nope.

If so, what would that be?

Changing the hoster, I guess.

Sign up to request clarification or add additional context in comments.

Comments

1

If your server is suphp enabled or if php is compiled as cgi &

the hoster has not specifically disabled use of local php.ini file,

then you will be able to override even disable_functions using a local php.ini file

Add a php.ini file with all your requirements on the document root of your website. It's recommended that you use the global php.ini used on the same server as a template php.ini file, and then modify the line -

disable_functions

so that exec is not present. This will work because as soon as you place a local php.ini on an suphp enabled server, the domain will stop using the global php.ini

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.