pkirsch Posted March 19, 2007 Share Posted March 19, 2007 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! Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/ Share on other sites More sharing options...
fert Posted March 19, 2007 Share Posted March 19, 2007 the only way you could hid the php.ini file would be to use .htaccess and you don't use include like this: include('http://www.mydomain.com/included/header.php'); you use it like this include('/included/header.php'); Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210327 Share on other sites More sharing options...
pkirsch Posted March 19, 2007 Author Share Posted March 19, 2007 Thank You very Much! Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210328 Share on other sites More sharing options...
pkirsch Posted March 19, 2007 Author Share Posted March 19, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210336 Share on other sites More sharing options...
fert Posted March 19, 2007 Share Posted March 19, 2007 include('../included/header.php'); //go down one directory include('../../included/header.php'); //go down two Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210337 Share on other sites More sharing options...
pkirsch Posted March 19, 2007 Author Share Posted March 19, 2007 Aah Thats what I was thinking! Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210338 Share on other sites More sharing options...
pkirsch Posted March 19, 2007 Author Share Posted March 19, 2007 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? Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210342 Share on other sites More sharing options...
wildteen88 Posted March 19, 2007 Share Posted March 19, 2007 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. Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210426 Share on other sites More sharing options...
pkirsch Posted March 19, 2007 Author Share Posted March 19, 2007 Thanks! I Appreciate This very Much! Quote Link to comment https://forums.phpfreaks.com/topic/43315-solved-phpinfincludes-questions-please-help/#findComment-210541 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.