PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
The purpose of this code is to allow includes to be used in files in the current folder as well as files in other folders. The code works fine under PHP 5.2.1, but throws warnings under 5.2.3. Any ideas why this might be occurring?
Which means that unless you have declared a value for $filename before the include of the sessions code, you are going to get undefined variable notices. The reason, I suspect, that you are not getting these in the other environment is because display errors is set to off or your error reporting level is less than E_ALL/E_STRICT.
Everah wrote:
Which means that unless you have declared a value for $filename before the include of the sessions code, you are going to get undefined variable notices. The reason, I suspect, that you are not getting these in the other environment is because display errors is set to off or your error reporting level is less than E_ALL/E_STRICT.
I see what you're saying, but the warnings I'm seeing include the $rootSpec variable, which is defined before sessions.php is included. Evidently PHP thinks I'm doing something bad, which is why I'm seeing the warnings. What's the recommended way to handle this? Also, the code runs fine, and I'd like to leave it for now while I'm deciding how to correct it. How do I downgrade the error reporting level on the 2nd box?
Everah wrote:
Which means that unless you have declared a value for $filename before the include of the sessions code, you are going to get undefined variable notices. The reason, I suspect, that you are not getting these in the other environment is because display errors is set to off or your error reporting level is less than E_ALL/E_STRICT.
I see what you're saying, but the warnings I'm seeing include the $rootSpec variable, which is defined before sessions.php is included. Evidently PHP thinks I'm doing something bad, which is why I'm seeing the warnings. What's the recommended way to handle this? Also, the code runs fine, and I'd like to leave it for now while I'm deciding how to correct it. How do I downgrade the error reporting level on the 2nd box?
So is the PHP engine assuming that it may or may not be defined as well, and throwing warnings? If so (I ask again), what's the better way to handle this, and how do I change the error reporting levels? I looked up error reporting levels at php.net, and I can add error reporting definitions to a single page, but they only apply to that page. Do they need to be added to httpd.conf or some other file to make them global?