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

 

 

 

 

I understand what you said but the problem I'm having is the fact that the include file is not in the same folder! The path is http://www.mydomain.com/included/header.php

 

You gave Me include('/included/header.php'); Which in my case does not work! What can I do to include a file in another .php file?

 

:D

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?

 

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.