I am writing a script that needs to modify the default php_admin_value[memory_limit] from 128 M to 512M. I don't get any errors when i execute the command from the CLI or from a bash script, but neither actually apply the update to the file. What am I doing wrong?
The line in the /etc/php-fpm.d/www.conf file is:
;php_admin_value[memory_limit] = 128M
Here is my the command:
sudo sed -i 's/;php_admin_value[memory_limit] = 128M/php_admin_value[memory_limit] = 512M/' /etc/php-fpm.d/www.conf
[
on the LHS should be escaped - see for example What characters do I need to escape when using sed in a sh script? – steeldriver Nov 03 '23 at 01:26