4

I've got full control of my Apache / WHM / CPanel server. I have a default PHP.ini file set up for everything and that is just fun for the production server.

On the same server, I have a staging/testing server - and on it I want display_errors to be ON instead of OFF (as it is in the production site of course). How can I tell the server to use a local PHP.ini file in that directory?

Thanks!

1

2 Answers 2

4

In complement to @i_forget answer: You can use the php_admin_value & php_value & php_flag & php_admin_flag directives to alter specific settings on a Virtualhost or on a directory.

<Directory /path/to/foo>
    php_value       include_path   ".:/var/www/foo/lib:/usr/share/php5/apc"
    php_admin_flag  file_uploads   on
    php_admin_value upload_tmp_dir "/my/tmp/upload/"
</Directory>

php_admin_value is safer than php_value (idem for flag) as the application cannot use ini_set to alter the value.

Here's it's one a Directory tag, so it could be as well on a .htaccess but you should'nt use .htaccess files if you have access to the configuration, use AllowOverride None :-). It could be as well on the VirtualHost, so before the the Directory tag.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, but for now I think it's simpler to do the above one... eventually I'll investigate doing it the right way as you described.
amazing worked good.. i turned file uploads only for phpmyadmin good.
3

add an htaccess file to the dir with the rule php_flag display_errors on

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.