enition Posted June 14, 2009 Share Posted June 14, 2009 Ok, probably a stupid question but i am using a framework that i don't want to modify any of the core files but at the same time stick to my own directory structure. I have managed to get my scripts running on my windows server but they failed when testing on a linux apache box. I have debugged and it is down to the way i have HAD to include the default controller file. To get around the requirement for the frame work loading a controller from a specific directory i used a dot dot slash mid path: ../test/app/controllers/../modules/welcome/controllers/welcome.php on windows this correctly translates to ../test/app/modules/welcome/controllers/welcome.php but on linux it just fails as it cannot include the file. I know it's not ideal having this but it's the only way to not mess with core files while stinging to a structure i wish to keep to. Is this just how it is or can i achieve this some other way? the ../test/app/controllers/ part of the path is created from the core... hence why i was trying the dot dot slash I could have sworn i have seen this work before on linux, so could it be server settings? I am running Apache/2.2.11 (Ubuntu) PHP/5.2.6-3ubuntu4.1 with Suhosin-Patch Any help would be great Thanks, Adam Quote Link to comment Share on other sites More sharing options...
trq Posted June 14, 2009 Share Posted June 14, 2009 You might try wrapping the path in realpath, otherwise, I don't see why it shouldn't be working. Quote Link to comment Share on other sites More sharing options...
enition Posted June 14, 2009 Author Share Posted June 14, 2009 Yeah, that was the first thought i had but the include happens in the core file so that would still mean modding it to wrap it with realpath() I don't get why it wouldn't work? trying this kind of path in a terminal does end in an error though but i thought that the include function provided by PHP would correct it/realpath it Quote Link to comment Share on other sites More sharing options...
trq Posted June 14, 2009 Share Posted June 14, 2009 What framework are you using? Any decent framework would make such an option configurable. Quote Link to comment Share on other sites More sharing options...
enition Posted June 14, 2009 Author Share Posted June 14, 2009 I am using codeigniter because it's nice a lightweight... I would say it was decent.. no probs, until now! But as you can see... i think they made a balls up by hard coding the controller directory if ( ! file_exists(APPPATH.'controllers/'.$RTR->fetch_directory().$RTR->fetch_class().EXT)) { show_error('Unable to load your default controller. Please make sure the controller specified in your Routes.php file is valid.'); } Also, after trying realpath it returns false. Seems like linux just doesn't like the dot dot slash mid path While im on the subject is there a name for the 'dot dot slash'? Trying to google that is a bit stupid! Quote Link to comment Share on other sites More sharing options...
eco Posted June 14, 2009 Share Posted June 14, 2009 oups, wrong post, sry. Quote Link to comment Share on other sites More sharing options...
enition Posted June 14, 2009 Author Share Posted June 14, 2009 hmmm... well after looking further into it, it seems that there is some sort of problem with the file exists routine..! If i do the include with the path containing the dot dot slash it loads fine!!! I am guessing then that this has something to do with my server setup... and highly likely down to the Suhosin patch Could someone with Linux+Apache2 WITHOUT Suhosin test this out for me?? Quote Link to comment 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.