How can I replace a string of text in a whole series php files throughout a series of folders and sub-folders?
Posted on 2012-08-15
My linux skills are pretty limited to "apt-get install"ing and "| grep"ing.
I have a pressing project that's lagging behind as I wait for my web developer to change the references in his php files to read from a remote mysql host instead of "localhost"
I can't afford to wait much longer, so I would like a backup option to do it myself if need be.
How can I from the command line replace "mysql_connect('localhost'," with "mysql_connect('mynewhost'," in all the php files in my /var/www/virtual and all it's sub-folders?