Attempting to store my mysql login credentials outside of the webroot and access via include. Attempted changing php.ini and .htaccess files to no avail. (Shared hosting on HostGator). Any ideas? The support guy wasnt of much help. He couldnt explain to me how i could access pear (which is outside the webroot) and not my include file.

Advanced thank-yous for any help.

    Where is the include file located, and how are you attempting to include it?

      file located here: /home/username/php/ ...
      trying to access via include("filename.inc");

      pear file located here: /home/username/php/HTML/Template/IT.php
      pear file accessed via include("HTML/Template/IT.php");

        If you look at a [man]phpinfo/man printout (or simply use [man]ini_get/man), what is the value for the 'include_path' PHP directive?

        Also, what is the PHP error message you're getting when you attempt the include() ?

          include_path ".:/usr/lib/php:/usr/local/lib/php"

          error: failed to open stream: No such file or directory

            Based on that include path, I can't see how your PEAR relative path would work either.

            Either add the 'php' directory to the include_path directive, or simply use a relative or absolute path to get to the file rather than relying on the include path. Note that you should be able to use $_SERVER['DOCUMENT_ROOT'] to get to the root of your site, followed by '../' to go up one directory.

              Write a Reply...