I always used a normal PHP file and just defined the variables in that file, but is this considered best practice?
Example:
It is quite safe and I don't think there is any best practice for constants, but I tend to gather them in a dedicated Constants class for readability:
Constants
class Constants { const DB_PASS = 'mypass'; }