ever heard of tlUser.php?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    ever heard of tlUser.php?

    I'm using __autoload() and for some reason I get an error on this system only (other works fine). First time I've seen this:

    "Failed opening required 'tlUser.php' "

    I've stripped my code and narrowed it down to one line: session_start() ;

    if the autoload() and session_start are the only two functions in a file, I get the above error. without sessionstart(), the code seems to work fine.

    Does autoload have a problem with session_start() in PHP 5.1.6?

    Googled at no avail. Can't find tlUser.php elsewhere on the server.

    Any ideas?

    Thanks,






    Dan


    Dan
  • Atli
    Recognized Expert Expert
    • Nov 2006
    • 5062

    #2
    What are the differences between the systems that worked and the one that didn't?

    First thing that popped into my head was... did you perhaps move from a Windows host to a Unix based host (excluding Mac OS X)?

    Windows file and directory names are case-insensitive, so if a file is saved as tluser.php and referenced as tlUser.php, that should work on Windows and Mac OS X, but fail on Unix systems, who use case-sensitive file-systems.

    Comment

    • dlite922
      Recognized Expert Top Contributor
      • Dec 2007
      • 1586

      #3
      Atli,

      I'm pretty well aware of case sensitivity. but tlUser.php is not /my/ file or code.

      In fact I don't know why PHP is looking for it. Theory:: The __autoload() is being invoked by some core PHP code which is obstantiates a class called tlUser ("new tlUser"). The overload of the autoload forces require_once. maybe I should add a check (file_exists()) before calling require_once.

      Anyway, current code:

      Code:
      session_start(); 
      function __autoload($className) {
          require_once("$className.php"); 
      }
      Well I actually didn't "move" the system, just the code has worked on this system before AND is currently working on other systems.

      I'm not sure what change what upgrade (if any) would change PHP's functionality.

      I don't really know where to troubleshoot from here. I cannot reinstall PHP on this live system.

      report as PHP bug under __autoload()?




      Dan

      Comment

      • Atli
        Recognized Expert Expert
        • Nov 2006
        • 5062

        #4
        Ahh ok I see.

        What if you tried creating an empty class called 'tlUser' under the include path.
        That way, the __autoload would be able to find it, and either be happy it found it and move on, or try to call a member of the empty class, which would give you a different error, telling you more about what the class is being called for.

        Comment

        • dlite922
          Recognized Expert Top Contributor
          • Dec 2007
          • 1586

          #5
          Genious!!!

          I hate myself for not thinking of that. Sometimes you let the negativity bring you down and you're locked. It's so easy to throw your hands up in despair when it's nearing 5:00 PM (Time to go home).

          I'd do this and let you know but I'm frustrated because it went away without me changing any part of the code.

          I don't know what cleared it up. I'll post back if it comes back.

          much thanks as always!




          Dan

          Comment

          Working...