Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Why on earth a public directory?
  • I'm already put off by fuelphp after just 30 seconds of trying to install it! Why on earth have you decided to put the starting point into a public folder??? I'm already having a nightmare setting it up on my localhost. I'm wondering what kind of setup the people behind fuelphp are coming from. As it cannot be by convention to add an extra level for accessing the index.php. And simply moving the content of the public folder into the application folder (where it belong in the first place) creates a true nightmare of changing file paths all over the place. Now, please, make it so that I can take the fuelphp folder, drop it into my root, rename it to whatever my website/webapp is named, and I'm good to go by typing [url=http://localhost/fuelphp]http://localhost/fuelphp[/url] (or whatever I decide to call my project). Thanks, really appreciate it.
  • Maybe you should start reading the documentation. The public folder should be your DOCROOT, so that all code is outside the docroot, and therefore not accessable from the browser. This is a security feature. This also works for virtually all shared solutions, where you have something like 'public_html' which is your shared hosts DOCROOT. Install FuelPHP so that your public files end up in this 'public_html' folder. If for some odd reason you can't use this setup, or you're not concerned about security, simply install everything in the DOCROOT, copy the contents of the public folder one level up, and remove the public folder. And you're in business again. That off course means you'll have to update the paths (all two of them) in your index.php. If you don't want it in your DOCROOT but in a folder, you can do exactly the same. This setup is not going to change. We are not going to compromise on security. oh, and talking about conventions, never use [url=http://localhost]http://localhost[/url]. It's not a valid hostname as per RFC, and you'll run into all kinds of issues with cookies and sessions if you do. Create a virtualhost for each website, and name it 'something.mymachine.local'.
  • Thank you for your answer. Well, I wouldn't want to consider a framework that have me worry about security issues in a basic installation (what I do from here is MY concern, security wise). That should have been solved by the framework. My setup for local development is that I have multiple websites in my root, some running different frameworks, and some using the same. I simply prefer to drop a folder into my root, rename it, and bam - start developing. And most of the frameworks I use do it this way. So why fuelphp uses a security argument to do it otherwise only makes me think that they haven't taken the security issues serious enough to actually fix them - and not make it my concern. I did read the manual though, and it just left me even more confused on the 'out of the root' paradigm - I prefer to stick with my development routine and not have ONE framework dictate me otherwise. And wouldn't it be an issue running multiple websites on the same server as you could only have on index.php in your docroot? I think I'm getting backed up by the following post (ignore that it's about WordPress, focus on the subject):
    http://wordpress.stackexchange.com/questions/58391/is-moving-wp-config-outside-the-web-root-really-beneficial By the way: the formatting toolbar ind this forum does not work - therefore the above link (probably - will it convert to a link when I post?) has to be copy/pasted into a browser.
  • I understand what you simply prefer. And you're perfectly welcome to stick to the way you always worked. But that doesn't change it. We prefer it this way. We have tens of thousands of users that understand our reasoning. We prefer to solve the access issue this way, instead of the clumsy hacks other frameworks use. Like for example checking the existance of a constant on the first line. Or blocking file access with .htaccess rules. A file that can't be accessed is a file that doesn't need access protection. There are more reasons for splitting the code from the frontend. For example, it easily allows you to install multiple applications on a single codebase. It also makes it very simple to do version control, since the different components are in separate repositories. If the simple 1 minute copy operation (which you only have to do once, you can zip it again for future deployments) is to much for you, and you expect us to change our structure and way of working just to please you, then maybe FuelPHP is not the framework for you. p.s. and we know the forum sucks, there's a new one on the way.
  • I DO see your points, but why is it such a nightmare to set it up then (i know I'm the one lacking the information)? But I can't find ONE simple, easy and understandable way to do it. So I'm simply asking: how do I: put fuelphp next to my htdocs folder (same level outside the root) and have project_one and project_two INSIDE the docroot, and be able to access them like [url=http://localhost/project_one]http://localhost/project_one[/url] and [url=http://localhost/project_two?]http://localhost/project_two?[/url] I simply can't understand why people this clever are not capable of EXPLAINING it (i know they know how to DO it) in a simple way (well, maybe it isn't so simple after all)? And no, I'm not angry at anyone - simply frustrated. And nobody should be that simply trying to INSTALL a framework.
  • See my previous post. * Copy the entire zipfile into [url=http://localhost/project_one]http://localhost/project_one[/url]
    * Move everything in the project_one/public folder one level up
    * Delete the now empty public folder
    * Open index.php in your editor, and remove "/.." from APPPATH, COREPATH and PKGPATH.
    * Open .htacess and change the rewrite to read "/project_one/index.php" And you're done. If you unpack the zip somewhere else, do the first 4 steps, then zip it again, you only have to do that once, for next deployments just use your own zipfile and change the name in the htaccess.
  • Thanks a lot. That really helped :).
  • Harro, those comments were so dumb I thought you were being trolled. Well done for answering so graciously!
  • Le gas-oil, c'est toujours un peu plus long à démarrer...
  • lol, génial!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion