3

so, I'm trying to get Zend Framework running, which has terribly vague instructions.

It simply says, put the Zend folder in the directory, and add it to your include_path in php.ini.

So, this is my include path:

include_path = ".:/usr/lib/php:/usr/local/lib/php:/home/tuner/public_html/market/Zend_1.12.3/library"

This is the section that should be including Zend, I have double checked the path:

/home/tuner/public_html/market/Zend_1.12.3/library

However, when I try to include a Zend class, I am still getting errors as though it is not included properly.

This is what is causing the error:

$locale = new Zend_Locale('en_CA');
Zend_Registry::set('Zend_Locale', $locale);

What am I doing wrong when including the framework?

2 Answers 2

1

You say you get an error when you try and include ZF class, but nowhere in the code you posted are you including a class (e.g. require_once 'Zend/Locale.php';). If you want ZF classes to be automatically included when you try and use them (which is the recommended approach), you need to setup the autoloader. For ZF1, add the following somewhere above your existing code:

require_once 'Zend/Loader/Autoloader.php';
Zend_Loader_Autoloader::getInstance();

ZF classes will then be automatically required in on demand.

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

Comments

0

I don't know which docs you got the code snippet from, but you are mixing up ZF1 and ZF2. The part with Zend_Locale and Zend_Registry are ZF1 components, so this is clearly not going to work with the ZF2 library installed.

1 Comment

Alright, I uploaded ZF 1.12.3 and tried it with that, same issue still.

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.