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] /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?

  • 1
    It would help to post the contents of that .htaccess file here. Please edit your question and include the portions of it with the php_value in them. – Stephen Ostermiller Feb 12 '18 at 11:32

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.