0

I have a server with WHM panel. OS is CentOS. When I put a php.ini in public_html PHP stops reading /usr/local/lib/php.ini.

When I compare results of phpinfo() what I see is;

error_log error_log error_log

becames

error_log no value no value

How can PHP reads master php.ini directives unless I add a directive in local php.ini.

PS: COPPYING MASTER php.ini CONTENT TO LOCAL php.ini IS NOT AN OPTION.

user9517
  • 115,471
  • 20
  • 215
  • 297
borayeris
  • 213
  • 1
  • 9
  • Please share more about why copying the master file is not an option. If we understand this constraint we might be able to better help. – Dan Armstrong Jan 30 '15 at 19:34
  • @Dan; Because I have 30 Web sites on my Web server. I don't want to do it every time I add a new site. – borayeris Jan 30 '15 at 19:48
  • [Administration panels are off topic](http://serverfault.com/help/on-topic). [Even the presence of an administration panel on a system,](http://meta.serverfault.com/q/6538/118258) because they [take over the systems in strange and non-standard ways, making it difficult or even impossible for actual system administrators to manage the servers normally](http://meta.serverfault.com/a/3924/118258), and tend to indicate low-quality questions from *users* with insufficient knowledge for this site. – HopelessN00b Mar 23 '15 at 21:52

1 Answers1

1

The short answer: you can't:

https://stackoverflow.com/questions/1391808/how-do-i-include-a-php-ini-file-in-another-php-ini-file

However, you can put php ini directives into an .htaccess file:

http://php.net/manual/en/configuration.changes.php

Or use ini_set function within your application itself:

http://php.net/manual/en/function.ini-set.php

Dan Armstrong
  • 821
  • 4
  • 6
  • I know but my suPHP doesn't let me to use php_value in .htaccess – borayeris Jan 30 '15 at 19:31
  • Any luck with "ini_set" in your app? I've used this extensively to develop apps that try to be compatible with various hosting environments. – Dan Armstrong Jan 30 '15 at 20:08
  • Dan my problem is when my customer puts a php.ini in his folder I want master directives are still active. – borayeris Feb 02 '15 at 00:20
  • I, too, wish this were possible. When I update our default php.ini configs, I manually look through all custom php.ini files to apply my changes, if they are not in conflict with any client customizations. Tedious indeed. I hope you find an answer for both of us. – Dan Armstrong Feb 03 '15 at 00:39