Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

turbobass

macrumors 6502
Original poster
May 25, 2010
294
3
Los Angeles
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 stream: No 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
 
@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 ;)
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.