1

I am trying to modify php.ini with sed commands but its not working for some reason

sed -i 's/disable_functions = /disable_functions = system, show_source, symlink, dl, shell_exec, passthru,escapeshellarg,escapeshellcmd/g' /etc/php.ini

The disable_functions line looks like this in php.ini

disable_functions =

Can you tell what is wrong

1
  • not working mean no change or error occuring ? if there is not change, trace the sed with =,l; at the start of the action string to display the line number and the content of the line (buffer in fact) before the s// occuring (in this case of tracing, don't use -i) Commented Dec 16, 2014 at 6:01

1 Answer 1

1

The problem is that in /etc/php.ini there is no space after the =

So remove the space after = from sed as

$ sed -i 's/disable_functions =/disable_functions = system, show_source, symlink, dl, shell_exec, passthru,escapeshellarg,escapeshellcmd/g' 
Sign up to request clarification or add additional context in comments.

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.