Zend Framework

Discussion in 'Web Design and Development' started by turbobass, Sep 2, 2011.

  1. turbobass macrumors 6502

    Joined:
    May 25, 2010
    Location:
    Los Angeles
    #1
    Having trouble setting up my Zend Framework locally with my Mac (I use MAMP). It simply looks like the php.ini is not adding the right path to the library of the Framework such that it fails once it actually hits any "require_once" in any of the Zend Framework files. Spent a couple days on it, do you know the answer to this vexing issue?

    I have edited the php.ini file that I am using for MAMP to be:

    Code:
    include_path = ".:/Applications/MAMP/bin/php5.3/lib/php:/Desktop/zendtest/zend/library"
    And yet I get a CLI error:

    PHP:
    Warning: require_once(Zend/Loader.php): failed to open streamNo such file or directory in /Users/John/Desktop/zendtest/zend/demos/Zend/Gdata/Docs.php on line 50

    Fatal error
    : require_once(): Failed opening required 'Zend/Loader.php' (include_path='.:/usr/lib/php'in /Users/John/Desktop/zendtest/zend/demos/Zend/Gdata/Docs.php on line 50
    And the Zend Installation Checker throws:

    Code:
    Exception thrown trying to access Zend/Loader.php using 'use_include_path' = true. Make sure you include Zend Framework in your include_path which currently contains: .:/Applications/MAMP/bin/php5.3/lib/php:/Desktop/zendtest/zend/library
     
  2. FourCandles macrumors 6502a

    Joined:
    Feb 10, 2009
    Location:
    England
    #2
    I only use MAMP lightly, and can't claim to be an expert on Zend, but I did notice in passing that support for Zend Optimizer was dropped in MAMP 2.0:

    http://blog-en.mamp.info/2011/07/mamp-2-released.html

    Apologies if that's irrelevant, just thought I mention.
     
  3. turbobass thread starter macrumors 6502

    Joined:
    May 25, 2010
    Location:
    Los Angeles
    #3
    @FourCandles
    No apologies necessary my friend, thanks for sharing.

    My issue is a bit different in that I am using the PHP framework -- meaning a set of PHP documents that allow you to build Zend PHP framework functionality into not only on or with the optimizer framework but just to your site in general.

    Specifically regarding this issue, soon after posting I realized that my problem was getting the CLI to use a php.ini file, as apparently they usually *don't*.

    Here's how you get the CLI to use a php.ini (in case anyone was wondering, lol):

    Code:
    php -c 'path/to/php.ini' path/to/file.php
    And that's it!!

    I had read about the -c flag in the man php but I guess my syntax was off, another way that a simple oversite can lead you far off the path ;)
     

Share This Page