0

I downloaded and unpacked the latest version of Zend Framework, onto OSX (10.6) (am also running webserver with XAMPP, but I added the include_path change to both XAMPP and OSX path, but this is all command line so I dont think the php compiler is using the XAMPP install)

I try to create a project and get the following: (note that i am replacing part of the path with "----" just for the purpose of privacy)

sh-3.2# zf create project testProject

Fatal error: Uncaught exception 'Zend_Exception' with message 'File "Zend/Tool/Project/Context/Zf/./AbstractClassFile.php" does not exist or class "Zend_Tool_Project_Context_Zf_._AbstractClassFile" was not found in the file' in /Volumes/----/----/z/library/Zend/Loader.php:99 Stack trace:

0 /Volumes/----/----/z/library/Zend/Tool/Project/Context/Repository.php(88): Zend_Loader::loadClass('Zend_Tool_Proje...')

1 /Volumes/----/----/z/library/Zend/Tool/Project/Context/Repository.php(79): Zend_Tool_Project_Context_Repository->addContextClass('Zend_Tool_Proje...')

2 /Volumes/----/----/z/library/Zend/Tool/Project/Provider/Abstract.php(87): Zend_Tool_Project_Context_Repository->addContextsFromDirectory('/Volumes/----/...', 'Zend_Tool_Proje...')

3 /Volumes/----/----/z/library/Zend/Tool/Framework/Provider/Repository.php(187): Zend_Tool_Project_Provider_Abstract->initialize()

4 /Volumes/----/----/z/library/Zend/Tool/Framework/Client/Abstract.php(128): Zend_Tool_F in /Volumes/----/----/z/library/Zend/Loader.php on line 99 sh-3.2#

Note the period after "Context_Zf_"

I've narrowed it down to this block of code:

File: /Volumes/----/----/z/library/Zend/Tool/Project/Provider/Abstract.php

public function initialize()
{
    // initialize the ZF Contexts (only once per php request)
    if (!self::$_isInitialized) {

        // load all base contexts ONCE
        $contextRegistry = Zend_Tool_Project_Context_Repository::getInstance();
        $contextRegistry->addContextsFromDirectory(
            dirname(dirname(__FILE__)) . '/Context/Zf/', 'Zend_Tool_Project_Context_Zf_'
        );
        $contextRegistry->addContextsFromDirectory(
            dirname(dirname(__FILE__)) . '/Context/Filesystem/', 'Zend_Tool_Project_Context_Filesystem_'
        );
        // determine if there are project specfic providers ONCE

Specifically "dirname(dirname(FILE))" is echoing as "."

if I wrap the block with an 'if (dirname(dirname(__FILE))!=".") { … } ', then I don't get that error, but I get another:

sh-3.2# zf create project testProject

An Error Has Occurred
Context by name applicationDirectory does not exist in the registry.

Zend Framework Command Line Console Tool v1.11.3 Details for action "Create" and provider "Project"
Project zf create project path name-of-profile file-of-profile

Charles
  • 50,943
  • 13
  • 104
  • 142
Mondo
  • 3
  • 1

2 Answers2

0

I tested on my Mac and it works fine. Have you tried to restart you xampp server, I don't really know how it works as I use Apache & PHP already installed versions not a "AMP pack". Maybe it's a problem with the php.ini include_path which has not been reloaded.

It's clearly a problem with the path as it don't succeed to build the class name :

"Zend/Tool/Project/Context/Zf/./AbstractClassFile.php"

the dot should not appear here. Can you share you PATH variable from the terminal and your include_path from your php.ini.

grandouassou
  • 2,500
  • 3
  • 25
  • 60
  • oddly enough, I can't find the correct php.ini file to change. I have changed 5 of them now, and nothing shows a change. I am running XAMPP, but am using terminal for running the zf command. 'which php' and 'php -i | grep php.ini' both show something outside of my XAMPP install. I think the best option now is to kill xampp and maybe try to native install for Zend server. – Mondo Mar 08 '11 at 20:26
0

Sadly the solution was to install zend server community edition, and have that take care of everything for me. For anyone else on OSX going this route, check out: http://cmorrell.com/webdev/installing-zend-server-zend-framework-on-os-x-291

includes the steps for enabling CLI support.

Mondo
  • 3
  • 1