include path to files outside the webroot

Asked by:
almurrin / 13 Points
2012-09-20 8:25 am EST
File Management
I put my include files outside my web root (for security), but I can't access them from inside the file (.php) in the webroot. I searched google and it seems that the absolute path should look like '/home//folder/filename.php'. In the error message that I get it says the include_path='.:/usr/lib/php:/usr/local/lib/php:/home//php'.

I don't see what I am missing. Is there something that I need to change in my php.ini file? (although I tried and I don't have access to change it.)

To ask this user for more information, please first login.

To submit an answer, please login.



16,266 Points
2012-09-20 9:44 am EST
Hello almurrin,

I checked your php.ini, located in your public_html directory and only see the following setting:

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

You may need to set it to be:
include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/username/php"

Be sure that the username is your cpanel username.

The php.ini was set to 444 permissions which prevented writing. You can change them by right clicking on the filename and selecting 'Change Permissions' from the menu. I went ahead and made it 644 for you so you can write. Be sure to change it back to 444 afterwards for security.

Best Regards,
Scott M

To submit a comment on this answer, please first login.

Want to share this Question?

Related Articles

It looks like there are no related articles.
Would you like to ask a question about this page? If so, click the button below!

Help Center Search

Current Customers

Email: Ticket: Submit a Support Ticket
Call: 877-595-4HUB (4482)
757-416-6627 (Intl.)
Chat: Click To Chat Now

Ask the Community

Get help with your questions from our community of like-minded hosting users and Web Hosting Hub Staff.

Not a Customer?

Get web hosting from a company that is here to help.