<?xml version="1.0" encoding="utf-8" ?><rss version="2.0" xml:base="https://www.webmaster-forums.net/crss/node/1021958" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title></title>
    <link>https://www.webmaster-forums.net/crss/node/1021958</link>
    <description></description>
    <language>en</language>
          <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135403</link>
    <description> &lt;p&gt;.inc files are not magical.  Files being included into a PHP file can have any extension, or no extension at all.  What causes the contents of the included file to be parsed as PHP, are the PHP tags (&lt;div class=&quot;codeblock&quot;&gt;&lt;code&gt;&lt;span style=&quot;color: #000000&quot;&gt;&lt;span style=&quot;color: #0000BB&quot;&gt;&amp;lt;?php&lt;br /&gt; &lt;br /&gt;?&amp;gt;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/div&gt;) which surround your code in the included file.&lt;/p&gt;
&lt;p&gt;Yes.  If you have include files with a .php extension within the webtree, you will see no php source code when viewing them directly from a browser.&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 23:52:07 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1135403 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135392</link>
    <description> &lt;p&gt;suzanne: the only browser i can get to open it are mozille, galeon and  konqueror .... but only when i&#039;m caling them FROM that computer using the internal address&lt;/p&gt;
&lt;p&gt;mark: so theoretically, if i have it as a .php i can have it IN the webtree and unless i&#039;m at the computer pulling it up in an editor i wont see the code? and will it act like a .inc file where the functions are responded to as if i wrote them in that file? or is the behavior different?&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 19:27:33 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1135392 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135385</link>
    <description> &lt;p&gt;Being outside of DOCUMENT_ROOT simply means that you cannot point your browser to that file directly.  Which is not a problem for files with a .php extensions on a properly configured web server.&lt;/p&gt;
&lt;p&gt;Think of all those those scripts on HotScripts.com with their config files within DOCUMENT_ROOT.  Heck, even vBulletin.  How many of them have you copy files outside of DOCUMENT_ROOT?&lt;/p&gt;
&lt;p&gt;Like I said earlier, I do this as well.  But I do this for convenience, not security.  For one of my current projects, several sub-domains require the same library files, includes, and config files.  Instead of keeping X copies (one for each sub-domain), I have one copy outside DOCUMENT_ROOT and use .htaccess to include the directory in PHP&#039;s include_path.&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 17:52:59 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1135385 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135384</link>
    <description> &lt;p&gt;Hypothetically, yes. Test!&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 17:26:51 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1135384 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135380</link>
    <description> &lt;p&gt;so since this is out of the web directory the include file wont be seen.. right?&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 16:09:42 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1135380 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135349</link>
    <description> &lt;p&gt;There is a suggestion from Kevin Yank (and probably many other more knowledgeable than I PHP programmers) to put .inc files in non-public directories so they cannot be viewed.&lt;/p&gt;
&lt;p&gt;Specifically he says:&lt;/p&gt;
&lt;blockquote class=&quot;bb-quote-body&quot;&gt;&lt;p&gt;Quote:&lt;br /&gt;
...you should put any security-sensitive code into an include file, and place that file into a directory that&#039;s not part of your Web server&#039;s directory structure. If you add that directory to your PHP include_path setting (in php.ini), you can refer to the files directly with the PHP include function, but have them tucked safely somewhere where your Web server can&#039;t display them as Web pages.&lt;/p&gt;&lt;/blockquote&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 04:34:57 +0000</pubDate>
 <dc:creator>Suzanne</dc:creator>
 <guid isPermaLink="false">comment 1135349 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135346</link>
    <description> &lt;p&gt;I&#039;m speaking from experience with Apache, though I would assume most other web servers would be configured the same.&lt;/p&gt;
&lt;p&gt;.php extensions are associated with the &quot;application/x-httpd-php&quot; mime type.&lt;br /&gt;
.inc extensions are usually not associated with any mime type, so fall under the default mime type of &quot;text/plain&quot;.&lt;/p&gt;
&lt;p&gt;&quot;application/x-httpd-php&quot; mime types are first parsed by the PHP interpreter, and only the output from the interpreter is sent to the requesting host.&lt;/p&gt;
&lt;p&gt;&quot;text/plain&quot; mime types are not passed through any interpreters, and so, are sent to the requesting host in their entirety.&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 04:22:33 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1135346 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135343</link>
    <description> &lt;p&gt;i&#039;m also root on this particular server, so while it&#039;s here i dont have to worry about future access &lt;img src=&quot;https://www.webmaster-forums.net/misc/smileys/big.png&quot; title=&quot;Laughing out loud&quot; alt=&quot;Laughing out loud&quot; class=&quot;smiley-content&quot; /&gt;&lt;/p&gt;
&lt;p&gt;however, if you could explain to me why a .php file would never be shown to a user yet a .inc file could be, i&#039;d love to hear it, since the very reason i have for doing that is to make it so people cannot see the contents of the file with the db pws as well as two otoher things i haven&#039;t finished masking all of it yet&lt;/p&gt;
&lt;p&gt;btw: you were right. needed to be 755 instead of 744&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 03:19:31 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1135343 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135341</link>
    <description> &lt;p&gt;First off, to you &lt;strong&gt;not&lt;/strong&gt; want to chown/chgrp any files to the apache user.  You will have a heck of a time editing (or even removing) them down the line.&lt;/p&gt;
&lt;p&gt;As for moving files outside DOCUMENT_ROOT... I do this too, but I wouldn&#039;t say it&#039;s more secure.  Having file extensions of .inc is what causes the security problem while within DOCUMENT_ROOT.  Had you used .php file extensions, the contents would never be shown to the user.&lt;/p&gt;
&lt;p&gt;Directory permissions are a tad different than file permissions.  If I remember correctly, +RX is necessary to list the contents of a directory. +R may suffice for accessing a known file within the directory, but I&#039;m not certain.  You may want to try setting you&#039;re /home/joshua to 755.&lt;/p&gt;
 </description>
     <pubDate>Thu, 31 Jul 2003 01:57:50 +0000</pubDate>
 <dc:creator>Mark Hensler</dc:creator>
 <guid isPermaLink="false">comment 1135341 at https://www.webmaster-forums.net</guid>
  </item>
  <item>
    <title></title>
    <link>https://www.webmaster-forums.net/serverside-scripting/php-includes-error#comment-1135335</link>
    <description> &lt;p&gt;the file has one include. all the files for the site have one include file. the include directory is outside of the web tree for security. the main include file is actually a list of include files, including the one with all the database passwords in it, which will be changed from 444 to 400 once i have everything running and know i wont need to change it. i also plan on chowning and chgrping it to apache (user the webserver runs as).&lt;br /&gt;
i figure at that point if anyone can crack into the db by using that file i have much bigger problems than stupidity in my code. and if i&#039;m allowed to do that when i find a real host for it, it helps security there... well helps me know the site&#039;s more secure.&lt;/p&gt;
&lt;p&gt;right now all the files in the include directory are 644 so that i may modify them, and apache may read them&lt;/p&gt;
&lt;p&gt;the include direcotry itself is 775&lt;br /&gt;
my home directory is probably the issue. if that&#039;s not the case i&#039;ll let you know&lt;/p&gt;
&lt;p&gt;nope. i set my home directory to 744 and /home is actually 775&lt;/p&gt;
&lt;p&gt;so....&lt;br /&gt;
/home/joshua/includes/fyd.incs.inc&lt;br /&gt;
has permissions&lt;br /&gt;
/775/744/775/644&lt;br /&gt;
the files it includes are also 644&lt;/p&gt;
&lt;p&gt;overview for those unfamilliar with chmod and numerical permissions:&lt;br /&gt;
4=read&lt;br /&gt;
5=read/execute&lt;br /&gt;
6=read/write&lt;br /&gt;
7=read/write/execute&lt;/p&gt;
&lt;p&gt;which means that the everyone can read the directory and files (for now)&lt;/p&gt;
 </description>
     <pubDate>Wed, 30 Jul 2003 22:31:19 +0000</pubDate>
 <dc:creator>m3rajk</dc:creator>
 <guid isPermaLink="false">comment 1135335 at https://www.webmaster-forums.net</guid>
  </item>
  </channel>
</rss>
