0
votes

Dears, please be patient with me I am really new to this,

I have a PHP 7.0.30-0ubuntu0.16.04.1 (cli) ( NTS ) Copyright (c) 1997-2017 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologieswith Zend OPcache v7.0.30-0ubuntu0.16.04.1, Copyright (c) 1999-2017, by Zend Technologies

My phpinfo() shows include_path .:/usr/share/php

If I change the php.ini (located in /etc/php/7.0/apache2/php.ini as per phpinfo() )

with for examples include_path .:/usr/share/php-king the phpinfo() shows the change after restarting apache2

but if I add a semicolon (;) in php.ini like ;include_path .:/usr/share/php-king

phpinfo() keeps telling me include_path .:/usr/share/php.

Question is: is there a way to disable the include path /usr/share/php

and have only ./ as the include_path ? (strange thing is that the /usr/share/php directory was not created during installation)

Thanks in advance

P.

1
If you comment out include_path in your ini file, it will take the default coded value to ensure it is not "undefined". - Nic3500
I'm curious, was my answer of any help? - Álvaro González
yes thank you, I didnt find a way to flag my question as answered. I still have to try to set as include_path the same path of my document root and see what happen. Thank you a lot indeed - pippo1980

1 Answers

1
votes

If you remove a directive from the system-wide configuration file PHP will just use the compiled-in default value. Most directives (if not all) cannot be completely wiped out from the environment and include_path in particular does not seem to allow empty values:

var_dump(ini_set('include_path', ''));
var_dump(ini_set('include_path', null));
bool(false)
bool(false)

In real life, though, you normally just want to restrict file inclusion to working directory:

var_dump(ini_set('include_path', '.'));
var_dump(ini_get('include_path'));
string(14) ".;C:\PEAR\pear"
string(1) "."