2

I want to know how can i use Zend Framework in my php project where my web host doesnt support it. Im using only bunch of the Zend classes, so can I put them inside my include folder and upload it to my site? Will this work?

2
  • Did you give it a try? Zend Framework is just a bunch of include files, so yea. It will work and your web host "not supporting" could be that their PHP Version is unsupported (IE PHP 4.x) by ZF. That would most likely be the main limitation, that and they may not offer some modules that certain ZF items require. Commented Nov 24, 2010 at 4:43
  • i didnt. but just curious, im going to do that, but need some clarifications.. Commented Nov 24, 2010 at 4:53

2 Answers 2

1

First include autoloader class.

require_once 'lib/Zend/Loader/StandardAutoloader.php';
$loader = new Zend\Loader\StandardAutoloader(array('autoregister_zf' => true));

$loader->registerNamespace('Http\PhpEnvironment', 'lib/Zend/Http');

//Register with spl_autoload:
$loader->register();

and then use below line

$a = new Zend\Http\PhpEnvironment\Request();
echo $a->getQuery()->get();

this is just the demo that you can use loosly coupled zend library to your project.

Sign up to request clarification or add additional context in comments.

Comments

0

Here is great place to get started http://framework.zend.com/manual/en/

If you host supports PHP 5, then Zend Framework will work without any problems.

Usually Zend directory is placed inside of lib directory, look at Quick Start.

4 Comments

Thanks for the lightning speed reply, I asked the host about the zend support they said they dont support zend framework. That's why I got the doubt, becasue if i want to modify the php_include to make zend work, then i cannot do that, because host has to do that.
most likely your hosting misunderstood you and answered in respect to Zend Optimizer. It allows to run PHP code that was compiled by Zend Guard.
so putting the zend framework folder inside my project and uploading to the web will work as it should? then Im happy, im going to upload and test now. I asked the question because my net is slow that 25Mb will take much time to upload.
It will work for sure. Don't be silly uploading all files extracted... it will take long time. Instead upload a zip/tgz archive and extract it on the server.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.