0

I'm using PHP 7.2.11 on my laptop that runs on Windows 10 Home Single Language 64-bit Operating System.

I've installed PHP 7.2.11 and Apache/2.4.35 (Win32) using the latest version of XAMPP for Windows.

I come across following paragraph from PHP Manual :

It is possible to configure PHP to scan for .ini files in a directory after reading php.ini. This can be done at compile time by setting the --with-config-file-scan-dir option. In PHP 5.2.0 and later, the scan directory can then be overridden at run time by setting the PHP_INI_SCAN_DIR environment variable.

I executed below code to check whether the environment variable PHP_INI_SCAN_DIR exist on my machine or not by executing below code in my web browser :

<?php
  var_dump(getenv('PHP_INI_SCAN_DIR'));
?>

Output of above code is :

bool(false)

The output clearly says that no such environment variable titled PHP_INI_SCAN_DIR does exist on my machine.

Then, my question is do I required to set/define/declare/specify/assign an environment variable titled PHP_INI_SCAN_DIR so that PHP can scan the additional directory/directories? If yes, then please let me know how should I define it and in which file it should be defined? If no, then how should PHP scan additional directory/directories?

Is this the case with Windows only that the environment variable PHP_INI_SCAN_DIR doesn't exist or is this the case with every other operating system on which PHP is running?

Is there really any need to make use of the environment variable PHP_INI_SCAN_DIR and scan additional directory/directories in my situation i.e. in Windows and XAMPP setup environment?

I'm asking this question because I've heard that mostly Linux operating systems do required to do all this stuff.

Thanks.

  • [Still](https://stackoverflow.com/questions/49485364/how-to-set-and-use-php-ini-scan-dir-environment-variable-in-php) on this? It's not necessary, unless you want to use a different directory than the compiled-in directory. And no, it's not required for Linux. Nobody needs this. – mario Oct 21 '18 at 14:48
  • @mario : Yes. Because I want to thoroughly understand the concept which the manual text fails to do. –  Oct 21 '18 at 14:50
  • Surely there must have been *some* takeaway from your previous questions, or at least an attempt to try it out by now? – mario Oct 21 '18 at 14:52
  • @mario : I'm still not getting what is mean by 'compiling PHP'? In my XAMPP setup isn't the PHP in compiled form? If softwares like XAMPP can do the process of PHP installation within few minutes and with few mouse clicks on all popular operating systems then why there is any need to go to the terminal/command prompt and do this head-aching stuff of compiling PHP with configuration options and all? Why not all people choose to use softwares like XAMPP to make the PHP installation process easy and feasible?Why few people are making their and others' life hard with this command prompt/terminal? –  Oct 21 '18 at 14:54
  • Everyone uses precompiled binaries. Unless they want something customized. If you don't, then use the builtin XAMPP defaults and don't work around them for no good reason. (You never mentioned what you [really want to accomplish](http://xyproblem.info/), other than pointless php.ini partitioning). Btw, compiling on Windows does not involve the terminal. – mario Oct 21 '18 at 14:59
  • @mario : By the term 'precompiled binaries' do you mean pre-configured packages like XAMPP, WAMP, AMPPS, etc.? If it's not the terminal then what does involve compiling on Windows? –  Oct 21 '18 at 15:10

0 Answers0