Please enlighten me on this one. I tried editing the php.ini file, on the part where it says include_path:
include_path = ".;C:\php_includes\home_made"
After that I uncommented it,save it and restarted all services from wamp tray icon.
I have a bunch of home made classes on that folder. I’m imagining that I could just do something like this on every php file that I make. And I’ll be able to use the functions in those classes:
$strings = new strings();
echo $strings->clean('bla$#@D232)*/');
But I was wrong since it returned this error:
Fatal error: Class 'strings' not found in C:\wamp\www\dw_fs\phpinfo.php on line 1
What benefit did I actually get from including a path in php.ini. How do I use it? Please enlighten me.
The include_path just allows to
includefiles without full path:What you wanted to use in your example is an
autoloaderin addition to setting theinclude_path:Then you can instantiate the strings class without manually including the required class file.