Always_populate_raw_post_data solution on shared hosting

Continuing the discussion from always_populate_raw_post_data = -1 , and yes, id did it:

I had the deadly “always_populate_raw_post_data” installation killer. Because I’m on a shared server at Rackspace, I don’t have access to the php.ini file. It’s shared among all the installations on the server, so they don’t want to make a change for me that might affect other customers. After much searching, I found the approach below that puts this in the .htaccess file:


EXAMPLE !! DO NOT USE !!

<IfModule mod_php5.c>_
     php_flag always_populate_raw_post_data -1
 </IfModule>

Still no luck. Got help from tech support at Rackspace, it turns out that “php_flag” should be “php_value”. Here’s the code, just insert in a file called .htaccess (or create it) in your root directory. Don’t need to restart MySQL. Works perfectly now!!

<IfModule mod_php5.c>
    php_value always_populate_raw_post_data -1
</IfModule>

The workaround on shared hosting is:

  • Create a file called “.user.ini” in the installation directory of piwik
  • Using the editor (CPanel has one), paste this code into the file: always_populate_raw_post_data = -1
  • Save the file
  • reload the piwik installation page

Can confirm on my own shared hosting this actually works.