Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想定义一些常量并从任何文件访问这些常量,而不在 php.ini 中包含任何文件。
换句话说,我在 C# 中搜索任何等效的 Web.Config->AppSettings
您应该在一个名为constants.php的文件中定义它们,然后更改您的php.ini设置,以便始终加载此文件,然后再加载其他任何内容:
php.ini
auto_prepend_file = /var/www/website/constants.php