What's wrong with this line of wordpress PHP code? (from a tutorial) -
I know that it is usually frowned upon, but I took this from a tutorial, so I wonder Why this is not working.
Here is the affected line of code:
$ document_root = rtrim (str_replace (array ('/', '\'), '/', $ _SERVER [' DOCUMENT_ROOT ']),' / '); Error Message in Apache's Error Log: [Sun Jul 27 01:01:47 2014] [Error] [Client 24.62.230.8] PHP Parse error: syntax error, unexpected '[DOCUMENT_ROOT]' (T_STRING), [8] hopefully on line 8 in 8/8/8/8 / wp / wp-config.php [July 27 01:01:47] [ Error] [client 24.62.230.8] PHP steak trace: [sun 27 July 01:01:47 2014] [error] [client 24.62.230.8] PHP 1. {main} () / home / folders / yp / index .fapx [Sun Zule 27 01:01:47 2014] [Error] [Client 24.62.230.8] Required PHP 2 () / Home / folder / WP / index.fp: 3 [sun July 27 01:01:47 2014] [error] [client 24.62.230.8] PHP 3. require_once () / home / folder / wp / wp-blog -header.php: 12
Reference: This is the tutorial that I have done to get it. Wp-config.php -
Try something like this:
< Code> $ document_root = rtrim (str_replace (array ('/', '\\'), '/', $ _SERVER ['DOCUMENT_ROOT']), '/');
Comments
Post a Comment