How do I work with suPHP and .htaccess files?

Some configuration lines won't work with suPHP - at least, not within the .htaccess file. In particular, "php_value" and "php_flag" values are the two that are problematic.

So, in order to resolve this follow the steps given below:

First, you must move all lines beginning with "php_value" and "php_flag" from your .htaccess file into a file called php.ini (in your public_html directory). Then, you must add a line to your .htaccess file like the one below (of course "username" being your actual username).

suPHP_ConfigPath /home/username/public_html

You will need to remove php_value and php_flag from ALL .htaccess files you may have. However, you only need to add the suPHP_ConfigPath line in the .htaccess file in your public_html directory only.

Secondly, you must make sure that the lines you put in php.ini are in the correct format:

setting_name = setting_value

Let's say you have the following line in your .htaccess file:

php_value register_globals 0

the corresponding php.ini format is as follows:

register_globals = Off

Notice how the value 0 becomes Off (without quotes) and 1 becomes On. If your php_value has quotes like the following, for example:

php_value include_path "/home/username/cgi-bin" 

The corresponding php.ini format is:

include_path = "/home/username/cgi-bin"

Was this answer helpful?

Also Read
Can I switch between PHP-4 and PHP-5?

Yes, you can easily switch between PHP-4 & PHP-5 anytime you wish. To see how, see the...

How to turn OFF magic_quotes_gpc ?

magic_quotes_gpc is a PHP flag that you can turn on/off easily. By default, it's always turned on...

How do I auto-redirect HTTP to HTTPS (SSL)?

To auto redirect from http to https (SSL) in Apache, add the following code to the top level...

How can I use Multiviews with LiteSpeed web server?

Multiviews is a webserver option directly supported by Apache, but not supported by LiteSpeed....

Do you offer any money back guarantee?

Yes, we do.Click here to see our refund / cancellation policy.