Php.ini include_path

I searched everywhere and cannot find an answer to this. I am trying to set the path to include in the php.ini file of my local Wamp server. Currently, I do not understand one of two things:

  • What to put in quotes of the path inclusion parameter itself.
    For example, if I wanted to add C:\wamp\www as an inclusion path, would it be
    include_path = ".;C:\wamp\www\" ?
  • Where to place the line include path . Can I place it anywhere, or do I need to place it in a specific place?

Some common errors that I read about in my research that I checked.

  • I am editing a php.ini file located in C:\wamp\bin\php\php5.3.8
  • I restarted the server after making the changes and checked if it was updated using the phpinfo() function.

UPDATE
This is currently what I have, but it still does not work.

 ; Windows: "\path1;\path2" include_path = ".;C:\php\pear;C:\wamp\www" 
+7
source share
4 answers

It all depends on what you are trying to achieve. Personally, I don't edit the php.ini file directly to set include_paths, instead I use the following construct in the code:

 // This will append whichever path you would like to the current include path // And I believe that PHP is smart enough to convert / with \ if on a windoze box // If not you can replace / with DIRECTORY_SEPARATOR set_include_path(get_include_path() . PATH_SEPARATOR . 'my/custom/path'); 

- Change -

Most likely, your system may have several copies of php.ini and that you are not editing the one used by PHP.

+10
source

There is already an include_path in the php.ini file, but is commented out, that's where you should put it, uncommenting it. It also has examples for windows. It will look like this: just remove the semicolon preceding the include_path

 ; Windows: "\path1;\path2" ;include_path = ".;c:\php\includes" 
+5
source

Click this link when I tried to debug why the include_path in my php.ini file did not take effect. I am talking about setting up ubuntu with bitnami api. The solution was to restart php-fpm using. / ctlscript. Restarted only apache, but had to restart php-fpm.

Hope someone try it in ubuntu with a light bulb.

0
source

If you find this stream and use the current version of WAMPServer, you may encounter a problem that I encountered when you edit php.ini, which is referenced in the phpinfo () report, but it does not change the inclusion path. Performing a search in the WAMP directory showed two DLLs (both php5ts.dll versions in php and apache dirs), where the inclusion path is indicated. Instead, use the WAMP Bitnami environment ( https://bitnami.com/stack/wamp/installer ). GO PATS!

0
source

All Articles