It is currently Tue Dec 07, 2021 5:24 am


All times are UTC


Forum rules


Please click here to view the forum rules



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: PHP cannot include file outside domain root folder
PostPosted: Mon Jun 15, 2020 8:09 pm 
Newbie
Newbie

Joined: Mon Jun 15, 2020 8:02 pm
Posts: 2
I use php and mysql. Many books and guides advise put sensitive information like database password and user name in separate file located outside of domain root folder, actually above this folder, one level higher. So, php script could access this files using command include ('../connect_info.php');, but hackers could not access this file via http request. This method works perfect with other web hosting providers. But when I use freehostia, php even cannot see files outside domain root folder. This method works if I put both files (main and included) in the same folder, however this is not good for security. I think this is because freehostia settings do not allow at all php to access files outside domain root folder. I can upload the file connect_info.php above domain root folder using FTP, but php cannot access this file. Please advise how can I access files located one level higher than my domain root folder using php include command - include ('../connect_info.php');


Top
 Profile  
 
 Post subject: Re: PHP cannot include file outside domain root folder
PostPosted: Tue Jun 16, 2020 4:53 am 
Newbie
Newbie

Joined: Thu Jul 05, 2018 3:15 am
Posts: 44
Hello,

This is because of a Jail Host option which prevents scripts from accessing files outside of their current directory. It can be disabled at the Hosted Domains section of the control panel.

In the future, if you are experiencing any issues or if you have any questions, please open a ticket from the control panel of your hosting account to the corresponding department so that we can properly assist you. You can open a ticket by hovering the mouse button over the Help Center button and selecting My Tickets.

Best Regards,
Jace Cohen

_________________
Jace is on the case!


Top
 Profile  
 
 Post subject: Re: PHP cannot include file outside domain root folder
PostPosted: Tue Jun 16, 2020 4:52 pm 
Newbie
Newbie

Joined: Mon Jun 15, 2020 8:02 pm
Posts: 2
It works now! Thank you so much for your help and advise.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ]  Moderators: Moderators, Support Team

All times are UTC


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Hosting | Domains | Servers | Extras | Order | Support | Contacts | FreeHostia © 2011