I know that to experienced ZF developers, this may sound silly, but please bear with me. Let’s use our imagination for a moment and say that I have a hosting package on a Linux server which does not give me access to the any folders outside of my htdocs folder (or www or public_html folders, whichever).
I know that all of the instructions recommend I install this framework outside of the htdocs folder for security, and set an include path in the PHP config to automatically give me access to this framework in all of the PHP files.
However, given the above constraints, this isn’t possible. My questions are:
- As far as how the framework goes, can I install this framework inside of my htdocs folder, say, placing it in its own dedicated folder at the same directory level as my application, and forbid public access to it using .htaccess?
- How secure is this approach, if I set Apache up to deny all non-local requests to this folder and its contents?
- Which core file(s) do I include in my scripts to give me access to the framework?
Sorry for the crash list of questions, but I have almost zero experience with the Zend Framework.
Thank you for you time.
You can upload the whole Zend library to your server. Best to place it outside your htdocs folder.
Then you use this line in your code:
Then you can use all zend just like normal: