includes causing an error
Posted: Wed Jul 30, 2003 3:03 pm
i know the second error is because of the include not working. what i don't know is why it doesn't since i called it by the line
the include file is OUTSIDE of the web directory
ie: /path/to/include/files/ != /path/to/web/files/
these are the errors:
Code: Select all
<?php
include("/path/to/include/files/includefile.inc");
?>ie: /path/to/include/files/ != /path/to/web/files/
these are the errors:
suggestions from a diff site, the only other one that's had people give answers that aren't off topic, wereWarning: Failed opening '/home/joshua/includes/fyd.incs.inc' for inclusion (include_path='.:/usr/share/pear') in /var/www/html/findyourdesire/phpTest/faq.php on line 2
Fatal error: Call to undefined function: bgnpg() in /var/www/html/findyourdesire/phpTest/faq.php on line 17
andAre you 100% sure the path is correct? why don't just just put <b>fyd.incs.inc</b> in /var/www/html/findyourdesire/phpTest?
and my response to them...Are you absolutely sure that is the correct path?
You're request_uri is in /var/www/html, but you're trying to pull an include from /home/joshua.
If the paths are correct, then check permissions. Make sure the user that the web server is running as has read access to the fyd.inc.inc file, and permission to the directory it's in.
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 644 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).
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'm allowed to do that when i find a real host for it, it helps security there... well helps me know the site's more secure.
right now all the files in the include directory are 644 so that i may modify them, and apache may read them
the include direcotry itself is 775
i set my home directory to 744 and /home is actually 775
so....
/home/joshua/includes/fyd.incs.inc
has permissions
/775/744/775/644
the files it includes are also 644
overview for those unfamilliar with chmod and numerical permissions:
4=read
5=read/execute
6=read/write
7=read/write/execute
which means that the everyone can read the directory and files (for now)