Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What can change the include_path between php.ini and a PHP file

I've inherited some code on a system that I didn't setup, and I'm running into a problem tracking down where the PHP include path is being set.

I have a php.ini file with the following include_path

 include_path = ".:/usr/local/lib/php"

I have a PHP file in the webroot named test.php with the following phpinfo call

 <?php
      phpinfo();

When I take a look at the the phpinfo call, the local values for the include_path is being overridden

                 Local Value                                        Master Value
 include_path    .;C:\Program Files\Apache Software Foundation\     .:/usr/local/lib/php
                 Apache2.2\pdc_forecasting\classes               

Additionally, the php.ini files indicates no additional .ini files are being loaded

Configuration File (php.ini) Path           /usr/local/lib
Loaded Configuration File                   /usr/local/lib/php.ini
Scan this dir for additional .ini files     (none)
additional .ini files parsed                (none)

So, my question is, what else in a standard PHP system (include some PEAR libraries) could be overriding the include_path between php.ini and actual php code being interpreted/executed.

like image 284
Alan Storm Avatar asked Dec 29 '22 19:12

Alan Storm


1 Answers

Outisde of the PHP ways

ini_set( 'include_path', 'new/path' );
// or
set_include_path( 'new/path' );

Which could be loaded in a PHP file via auto_prepend_file, an .htaccess file can do do it as well

phpvalue include_path new/path
like image 188
Peter Bailey Avatar answered Jan 01 '23 11:01

Peter Bailey