Title: &#8216;wordpress.php&#8217; file in root directory
Last modified: August 19, 2016

---

# ‘wordpress.php’ file in root directory

 *  [brockangelo](https://wordpress.org/support/users/brockangelo/)
 * (@brockangelo)
 * [17 years, 9 months ago](https://wordpress.org/support/topic/wordpressphp-file-in-root-directory/)
 * I am trying to understand the origin of a ‘wordpress.php’ file that exists in
   the root directory of one of the wp sites that I support. I know this isn’t part
   of the initial build, but it may have been created by a plugin (perhaps WP-Auto-
   Upgrade?)
 * Here is the content of the file:
 *     ```
       <?
               system("gunzip ./wordpress.tar.gz");
               system("tar xf ./wordpress.tar");
               system("rm -f ./wordpress.tar");
   
               $fp = fopen("./wp-config-sample.php", "r");
               $filecontent = fread($fp, filesize("./wp-config-sample.php"));
               $new_content = eregi_replace("%%DBNAME%%", $_REQUEST["db"], $fileconten$
               $new_content = eregi_replace("%%DBUSER%%", $_REQUEST["u"], $new_content$
               $new_content = eregi_replace("%%DBPASS%%", $_REQUEST["p"], $new_content$
               fclose($fp);
   
               $fp = fopen("./wp-config.php", "w");
               fputs($fp, $new_content);
               fclose($fp);
       ?>
       ```
   
 * It appears to simply take the data from wp-config-sample.php and place it into
   the wp-config.php file. Anyone know the story behind this?

The topic ‘‘wordpress.php’ file in root directory’ is closed to new replies.

 * In: [Everything else WordPress](https://wordpress.org/support/forum/miscellaneous/)
 * 0 replies
 * 1 participant
 * Last reply from: [brockangelo](https://wordpress.org/support/users/brockangelo/)
 * Last activity: [17 years, 9 months ago](https://wordpress.org/support/topic/wordpressphp-file-in-root-directory/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
