Title: File uploads and suPHP
Last modified: August 19, 2016

---

# File uploads and suPHP

 *  Resolved [grindlay](https://wordpress.org/support/users/grindlay/)
 * (@grindlay)
 * [16 years, 2 months ago](https://wordpress.org/support/topic/file-uploads-and-suphp/)
 * Problems uploading media when your host uses suPHP, or has file_uploads off in
   php.ini ?
    This has caught me out a few times, so here is my workaround.
 * Firstly, file uploads are **off** in php.ini, a common security measure for sensible
   hosting companies.
    To override, you need to place a custom php.ini file in your
   web space, along the lines of :
 *     ```
       ;;;;;;;;;;;;;;;;
       ; File Uploads ;
       ;;;;;;;;;;;;;;;;
   
       ; Whether to allow HTTP file uploads.
       file_uploads = On
   
       ; Temporary directory for HTTP uploaded files (will use system default if not
       ; specified).
       upload_tmp_dir = /home/account_name/tmp/uploads
   
       ; Maximum allowed size for uploaded files.
       upload_max_filesize = 2M
       ```
   
 * Bear in mind that using a wee snippet like this will mean that the rest of your
   php.ini variables will take on default values, rather than those specified in
   your host’s global php.ini.
    If you can lay your hands on the server global php.
   ini, use that instead and just modify the relevant lines to match the above.
 * This will work OK until your host deploys suPHP, another sensible security measure
   for sensible hosts. To get the php.ini snippet working with suPHP, you need to
   add the following line to the .htacess file in the root of your WP installation:
 *     ```
       # BEGIN WordPress
       <IfModule mod_rewrite.c>
       RewriteEngine On
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule . /index.php [L]
       </IfModule>
   
       # END WordPress
   
       suPHP_ConfigPath "/home/account_name/php"
       ```
   
 * When WP is updated (or re-installed), this line may get overwritten, so write
   yourself a note to remind you put the line back in.
 * Best to keep your php.ini snippet out of the public web space and hidden from
   prying eyes, so don’t put it somewhere like /public_html/php or /www/php. Put
   it in the folder above and reference it with the correct path in the .htaccess
   file.

The topic ‘File uploads and suPHP’ is closed to new replies.

## Tags

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

 * In: [Installing WordPress](https://wordpress.org/support/forum/installation/)
 * 0 replies
 * 1 participant
 * Last reply from: [grindlay](https://wordpress.org/support/users/grindlay/)
 * Last activity: [16 years, 2 months ago](https://wordpress.org/support/topic/file-uploads-and-suphp/)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
