Ninjakreborn Posted October 30, 2006 Share Posted October 30, 2006 See this isn't working.I made this framework, if it was working all the itme, it would speed up time, but now it's just more trouble than it's worth.I have a folder called master.In this folder I have a folder for images, ajax, javascript, css, includes, processors, and portable.images - carries all the images for the websiteajax, javascript, css - has a global.ext file for that specific type for all the website's stuff.includes, processors - contains all the file's necessary for the website's includes. Whether it's processor's that are dealing with contact us processing or something similar, or the include's for the website.Portable - This has a mini version of each set of file's. For instance if I wanted just the config file's without the directory structure, I can just pull that out and I have it, if I just need my library of javascript or ajax I can just pull those out for a specific purpose. It's basically just a quick version of whatever I need.I was happy with this, very happy. I really liked the setup but now I am having trouble getting include's to work.I can't get them all to work, I thought document root, then the filename was alway's going to work on most/any server's. However before I even use it 3-4 time's I run into a site giving me problem's with the include's, I even ran chmod on the file's I needed before using them, but it's not working. Is there a permanent way to make this work. Or should I change the way I am doing my functions. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/ Share on other sites More sharing options...
trq Posted October 30, 2006 Share Posted October 30, 2006 its really shouldn't be too difficult. Maybe take a look at the [url=http://php.net/set_include_path]set_include_path[/url] function. I allways append my includes directory to the include path, its just easier.If you have access to the php.ini you can also set this there. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116711 Share on other sites More sharing options...
Ninjakreborn Posted October 30, 2006 Author Share Posted October 30, 2006 Still absolutely nothing.I tried the set include path with everything but it's not working.I tried setting it likeyou showed but with a url of$docroot . "/master/includes/"or $docroot . "includes""/master/includes""includes"nothing is working. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116732 Share on other sites More sharing options...
trq Posted October 30, 2006 Share Posted October 30, 2006 This really is pretty simple stuff, I just don't know what to say really. Can you show us your exact file structure somehow? Or even just an example? What part of the set_include_path function don't you understand and can we see how you tried to impliment it?[quote]I tried setting it likeyou showed but with a url of[/quote]Sorry, but I havent posted any examples so Im not sure what your talking about here. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116736 Share on other sites More sharing options...
Ninjakreborn Posted October 30, 2006 Author Share Posted October 30, 2006 OkI was having this work fine earlier.Here is a cut down of my entire directory structure and explanation.Inside the root directory of the website.Whatever the actual root is So if the website is www.freelancebusinessman.com for instanceit's in the public_html folder, whatever the root directory is.Okinside the root directory i have a folder called masterthis is what I am also calling my framework, I wanted an easy way to organize my folder structure.Inside the master folder I have the following folders.images (still debating on whether I am going to have these in the framework or not, it would make it easier to keep up with.config - It contains config.php and a folder called functions (this folder is what I ahve my function incluide's at, and the one I am currently having trouble accessing.In master folder I also haveajax, javascript, css folder's each one with global.ext(there filename).I also have portable folder, which is a cut down version of the framework without the folder structure.So here is the total setup of my direction structurefolder structuremasterimages, css, javascript, ajax, portable, config, includesThe inside of those folder's it'simages (the images)css, javascript, ajax (global.css, global.js, global.js(for javascript), respectively.)config (config.php, functions (the one I am having trouble getting to include into config.php which was working earlier)includes (my website includes, this I don't seem to be having problem's with, atleast never have before.)and that's the folder structureI don't understand, I never had problems getting the include to work before.I tried doing a few things. Here is my entire config.php file[code]<?phpsession_start(); // starts session automatically################################################################### Joyel Puryear / Master Configuration System ## The Freelance Businessman ## http://www.freelancebusinessman.com ## Copyright Joyel Puryear 2006 ## ©Master Framework # ##################################################################/* Config File for the master framework */// Master Variables$docroot = $_SERVER['DOCUMENT_ROOT'];$contactemail = "businessman332211@hotmail.com";$elevel = 1; // level of error function (either 0 for off, 1 for on)$dbactive = "yes"; // either yes or no$dbhost = "localhost"; // Normally local host$dbusername = "######";$dbpassword = "#####";$db = "######";// connection informationif ($dbactive = "yes") { // if yes perform db workmysql_connect($dbhost, $dbusername, $dbpassword);mysql_select_db($db);}// making my include's work properlyini_set('include_path', $docroot . "/master/config/functions");// Handling php security issuesrequire_once($docroot . '/master/config/functions/security.inc.php'); // security includeerror($elevel); // function to set error level, defaulted to all and strict.ini_set("magic_quotes_gpc", 0);ini_set("register_globals", 0);// include master function controllerinclude($docroot . '/master/config/functions/master.inc.php'); // master include?>[/code]Ok the docroot was working perfectly before, in all server's I tried it, but now I run into thisAnd no matter what I change the include path to it keep's happening.I don't understand it much.I tried setting it with set include path, and ini set but nothing is working.I was hoping I could have include's that worked universally no matter what the structure.Should I remove the functions folder, and just have them under config, but I wanted them seperated into a specific folder for functions.I have 2 set's of incldues for the site, the includes with my functions for my frameworkand include's for the site itself. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116742 Share on other sites More sharing options...
448191 Posted October 30, 2006 Share Posted October 30, 2006 [code]ini_set('include_path',$_SERVER['DOCUMENT_ROOT'].'/master/config/functions/');require_once('security.inc.php'); [/code]If above doesn't work, the file is not there.echo $_SERVER['DOCUMENT_ROOT'].'/master/config/functions/';Above directory will not exist, or doesn't contain a file named 'security.inc.php'. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116763 Share on other sites More sharing options...
Ninjakreborn Posted October 30, 2006 Author Share Posted October 30, 2006 It has something to do with the damn permissions.I just checked just now, and now all of a sudden it's saying access denied through ftp.I tried earlier chaning around permission's but it never would let me on security.inc.phpdo you tihnk I will run into this problem much with my frameworkI also went ahead and tried chmod it didn't work Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116773 Share on other sites More sharing options...
trq Posted October 30, 2006 Share Posted October 30, 2006 You'll also want to make sure you include the current path, otherwsie things like PEAR may not be accesable.[code=php:0]ini_set('include_path',get_include_path().':'.$_SERVER['DOCUMENT_ROOT'].'/master/config/functions/');[/code] Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116774 Share on other sites More sharing options...
Ninjakreborn Posted October 30, 2006 Author Share Posted October 30, 2006 :oI really, really don't get it.He double checked the permission's they are all in order, I tried that it didn't work, I quadruple checked for the file, it's not working. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116783 Share on other sites More sharing options...
Ninjakreborn Posted October 30, 2006 Author Share Posted October 30, 2006 I found out what it was.Inside the document root, it traced it to the root folder but left out the rootoakley folder.So it left out that so I had to do $docroot . "oakley/master/whateverand it finally worked, I had to do that on the css file's as well, put the oakley before the Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116791 Share on other sites More sharing options...
akitchin Posted October 30, 2006 Share Posted October 30, 2006 PHP-included files (such as functions files, settings, whatever PHP itself includes) can be included using the server's FILESYSTEM path. that is, it can be referenced by its absolute path on the server. this path can be found in the phpinfo() output, and is often properly stated in $_SERVER['SCRIPT_FILENAME'] or $_SERVER['PATH_TRANSLATED']. be careful that those will give the currently executing script, not the including script.images, CSS and javascript that are referenced by HTML must be designated via URI paths. that is, they need to have their paths specified either explicitly by URL (ie. http://www.freelancebusinessman.com/images/image.gif) or by reference to the web root, which is usually www/ or public_html/ in the filesystem (ie. images/image.gif).the important part of this post is that you CAN NOT use the absolute filesystem path to specify image, CSS or javascript sources in HTML. you must specify a URI, which often means you'll need one defined path for PHP includes and one defined path for HTML includes. Quote Link to comment https://forums.phpfreaks.com/topic/25577-advice-about-framework/#findComment-116967 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.