Title: PHP &#8211; Rename command
Last modified: August 21, 2016

---

# PHP – Rename command

 *  [z](https://wordpress.org/support/users/murenti/)
 * (@murenti)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/php-rename-command/)
 * Hi,
    I am trying to move a file using the command below: rename(“/wp-content/
   plugins/dm-custom/$file”, “$my_theme_root/$newfile”); but I get the following
   error “Cannot rename a file across wrapper types”
 * I have checked [http://php.net/manual/en/function.rename.php](http://php.net/manual/en/function.rename.php)
   which says that “The wrapper used in oldname must match the wrapper used in newname”
   
   I have tried variables of the oldname ($file) and newname ($newfile) but the 
   same error shows.
 * Does anyone have a suggestion on this please? Very grateful for you help.
 * FYI Variables in above are shown below
    $my_theme_root = get_stylesheet_directory_uri();
   $file = ‘dm-custom-m.css’; $newfile = ‘dm-custom-master.css’;

The topic ‘PHP – Rename command’ is closed to new replies.

## Tags

 * [php-error](https://wordpress.org/support/topic-tag/php-error/)

 * 0 replies
 * 1 participant
 * Last reply from: [z](https://wordpress.org/support/users/murenti/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/php-rename-command/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
