Jump to content

[SOLVED] php.inf/Includes Questions, Please Help!


pkirsch

Recommended Posts

:) Hello Everybody!

 

Ok I have a few questions:

 

1: what can I do to hide my php.inf file (do I need to?) Today I typed "http://www.mydomain.com/php.inf" in Firefox and wallah there it was! I saw everything in it! That does not seem to be ok!? My webhost put's it in the "public_html" folder! Is that normal? Where should it go? How can I hide it?

 

----------------------------------------------------------------------

 

2: I am trying to use a include() tag and it's not working!

 

 

<?php include('http://www.mydomain.com/included/header.php'); ?>

 

 

The error im getting is:

 

 

 

Warning: include() [function.include]: URL file-access is disabled in the server configuration in /home/mydomain/public_html/myfolder/index.php on line 9

 

Warning: include(http://www.mydomain.com/included/header.php) [function.include]: failed to open stream: no suitable wrapper could be found in /home/mydomain/public_html/myfolder/index.php on line 9

 

Warning: include() [function.include]: Failed opening 'http://www.mydomain.com/included/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydomain/public_html/myfolder/index.php on line 9

 

 

Do i need to configure my "php.inf" a certain way? If so how?

 

----------------------------------------------------------------------

 

 

Thanks so much for your valuable time!  :D

 

 

 

 

Link to comment
Share on other sites

I'm now getting another error!

 

 

 

Warning: include() [function.include]: open_basedir restriction in effect. File(/included/included_pages/header.php) is not within the allowed path(s): ('.:/proc/uptime:/tmp:/home:/usr/local/lib/php:/nfs/home:/usr/home:/usr/local/bin/') in /home/mydomain/public_html/folder/index.php on line 10

 

Warning: include(/included/included_pages/header.php) [function.include]: failed to open stream: Operation not permitted in /home/mydomain/public_html/folder/index.php on line 10

 

Warning: include() [function.include]: Failed opening '/included/included_pages/header.php' for inclusion (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/mydomain/public_html/folder/index.php on line 10

 

 

What does this mean and what do I do to fix this?

 

Link to comment
Share on other sites

You are not using the correct path for the include. The following include path:

/included/included_pages/header.php

 

you have specified is telling PHP to go to the root file system (/) in a folder called included_pages and to include a file called header.php.

 

Now obviously the root of file system will be strictly off limits to you.

 

What you will want to do is add a period before the / in your inlude path. So try this:

include('./included/included_pages/header.php');

That now tells PHP to go from the current working directory.

If the folder called included is in a different folder higher up the directory tree then use ../ to go up one higher in the directory tree instead.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.