I want define some constants and access those from any file without including any file in php.

in the other word i search for any equivalent of Web.Config->AppSettings in C#

1

There are 1 best solutions below

1
On BEST ANSWER

You should define them in a file called constants.php and then change your php.ini settings so that this file is always loaded, before anything else:

auto_prepend_file = /var/www/website/constants.php