Mobile app version of vmapp.org
Login or Join
XinRu657

: "Invalid command 'php_value'" in .htaccess for WordPress site after switching hosts I moved my site which was on 00webhost to a new host. I set everything up but a 500 internal error shows

@XinRu657

Posted in: #Htaccess #Wordpress

I moved my site which was on 00webhost to a new host. I set everything up but a 500 internal error shows up.

The error log reports the following:


[Sun Feb 11 23:43:59.139864 2018] [core:alert] [pid 549884:tid 140054322136832] [client 77.75.78.164:60560] /home/dotcomwo/public_html/.htaccess: Invalid command 'php_value', perhaps misspelled or defined by a module not included in the server configuration


What should I do to get it working?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @XinRu657

1 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

It's quite probable you've moved from a host where PHP was installed as an Apache module and is now configured as CGI/FastCGI. Instead of using php_value in .htaccess, you'll need to set these values in a .user.ini file instead. The format is the same as php.ini. (Some hosts also allow a local php.ini as well.)

The .user.ini file (note the dot prefix) goes in the document root of your site, just like .htaccess, but contains just the settings that relate to PHP.

For example, if you previously had something like the following in .htaccess:

# Include a PHP file on every request
php_value auto_prepend_file /home/dotcomwo/public_html/includes/config.inc.php


Then you would write this like the following in a .user.ini file:

; Include a PHP file on every request
auto_prepend_file="/home/dotcomwo/public_html/includes/config.inc.php"

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme