Configure PHP INI to load default PHP file

Asked

Viewed 270 times

3

How to set up php.ini to load a PHP file that contains some generic functions where I use in all my root projects?

I read something about include_path, but I do not understand and believe that it does not suppress what I need!

  • I don’t know if I can, I never went for it because it’s not a good idea. I wouldn’t even waste my time looking.

  • For what I want to do would be great! I have a several projects interconnected in a root, and within this root I have settings file. But for me to have access to these settings I need to call this function in all projects without getting include in files..

  • You think you’d be great, but you don’t know what you’re getting yourself into.

1 answer

1

I don’t know why you need it, but here it comes:

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

include_path = "/var/meus_includes"

Note that you can include more than one Director:

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

  • Finally, restart the server:

sudo service apache2 Restart

Browser other questions tagged

You are not signed in. Login or sign up in order to post.