I am trying to allow the allow_url_fopen
and rename
functions temporarily for a script. I can do it with just one function, but not both.
Something like this:
php -d allow_url_fopen=on rename=on <file>
I'm using PHP 5.6
Apparently rename()
is in the disable_functions
in my php.ini file (whereas allow_url_fopen
is turned off outside of that), so I'm assuming the -d
option doesn't change the settings for the disable_functions
directive.
Therefore, the original question still stands, and a new one:
Is it possible to enable a disabled function with the command line tool? Or would I have to redefine the whole disable_functions
directive (if possible)?
This works for my situation:
php -d disable_functions=fn1,fn2,etc -r 'ini_set("allow_url_fopen", "1");' <file> <args>
You cannot use ini_set()
to change the disable_functions
directive. If there is another directive in your php.ini file that cannot be changed by ini_set()
then I don't know how to solve that. My issue has been resolved, although the original question hasn't been answered yet.
You must only define a -d OPTION
block for each setting you like to define.
You need to run:
php -d allow_url_fopen=on -d rename=on <file>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With