Configure PHP INI to load default PHP file


How to configure php.ini to load a PHP file which contains some generic functions which I use in all my root projects?

I read something about include_path , but I don't understand and I believe it doesn't suppress what I need!


I don't know why you need this, but here it goes:

  • Open the PHP.ini file, and search for "include_path":
  • Change your value:

include_path = "/var/my_includes"

Note that you can include more than one directory:

include_path = "/var/inc1:/var/inc2:/var/inc3"

  • Finally, restart the server:

sudo service apache2 restart

Scroll to Top