I’m working on my Xisto hosting account and I uploaded a script to the ETC folder. It’s the one sitting right next to public_html, not inside it. Can someone confirm if the correct path is something like /home/user/etc/? I need to access this file from a script inside my public_html directory. Also, is it possible for a PHP script to read files from that folder? Any help appreciated.
You’re correct about the path. But keep in mind that files in the etc folder are not web-accessible — they can only be accessed via scripts running inside public_html using relative path traversal. For example, if your script is at public_html/forum/index.php, you can include a config file from etc like this:
<?php
$config = include __DIR__ . '/../../etc/config.php';
?>
You may need to adjust the number of ../ based on your directory depth. Also, ensure the file permissions are set correctly (e.g., 644) so the web server user can read it. I tested this on my Xisto account and it works fine. Just remember that direct URL access to the etc folder will result in a 400 Bad Request error, so your sensitive data stays safe.
