Easy question... /etc/php.ini versus /usr/local/zend/etc/php.ini and include_path

matt1237
matt1237 used Ask the Experts™
on

WHICH FILE?

Which php.ini should be the authority in CentOS 6 with Zend Server CE installed? Is one for browser and one for CLI? Can I just symlink one to the other so I can maintain one file?

1. Default

/etc/php.ini

2. Zend

/usr/local/zend/etc/php.ini

WHAT INCLUDE PATHS?

There are two different include paths... how do I merge them when it appears there are two separate pear paths? Can I include both pear paths or is one the correct one?

1. Default

include_path = ".:/usr/share/pear"

2. Zend

include_path=".:/usr/local/zend/var/libraries/Zend_Framework_1/default/library:/usr/local/zend/share/pear"
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Dave BaldwinFixer of Problems
Most Valuable Expert 2014
Commented:
You probably should not try to combine them.  It is not unusual for there to be more than one 'php.ini' file.  And yes, the first reason is one for the web server and one for the command line.  In 'php.ini' for the command line, you do not want to reference features that are only available thru the web server.

I seem to have at least two copies of 'php.ini' on all my systems.

Author

Commented:
So to be clear, are these statements true?

/etc/php.ini is for command line
Do NOT merge the two include_path strings as they are used for two purposes
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
Yes, I believe so.  'httpd.conf' or 'apache2.conf' will show which one is being loaded for the web server.  I have never installed Zend but for other reasons I have two separate 'php.ini' files on most of my machines.
Dave BaldwinFixer of Problems
Most Valuable Expert 2014

Commented:
I booted up my Ubuntu Linux system and checked it.  It installs with separate 'php.ini' files in different directories.  I also found out that my 'cli' version never got updated when I upgraded the machine!  Shows a bunch of errors!
Commented:
Q.  /etc/php.ini is for command line ?

A. not exactly but yes default php parameters  are being read from this file.


Q.  Do NOT merge the two include_path strings as they are used for two purposes

A. Yes, Zend include_path does work specific with zend framework calls

TY/SA

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial