I need the following lines added to the top of my PHP file using a single bash script.
I'm new to the Sed / Awk commands specifically. I'm familiar with many other Linux commands.
Here are the lines.
[xdebug]
zend_extension=/usr/lib/php/20150306/xdebug.so
xdebug.remote_host = notsharingmydomainsorry.com
xdebug.idekey = "MYKEYIMNOTSHARING"
xdebug.remote_autostart = 1
xdebug.remote_connect_back = 1
xdebug.remote_enable=1
xdebug.remote_port=9000
xdebug.show_local_vars=0
xdebug.var_display_max_data=10000
xdebug.var_display_max_depth=20
xdebug.show_exception_trace=0
xdebug.remote_handler=dbgp
The second line: I'd like to replace the hard coded location with find / -name "xdebug.so"
but I keep mangling the syntax.
The php.ini file is located in /etc/php/7.0/fpm/php.ini
I need to add these lines right after the initial [PHP] at the top of the file. This is going into the automated deployment for our dev server.
I'd rather not do a Sed / Awk command that utilizes an external file. I have the entire deployment script for each server in one file and I'd like to keep it that way.
I know you can do things like sed -i filenamewithbits.txt filenametochange.txt
I'm not interested in this, however well it works.