SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Arrow Zend Framework on XAMPP?

    Hello guys

    can you show me a good tutorial, on how to properly setup Zend Framework under XAMPP.

    Thank you veyy much in advance.

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Unzip the the Zend archive to some location, probably in the directory of your application. Then include it...
    PHP Code:
    <?php

    require 'path/to/zend/loader.php';
    Zend_Loader::registerAutoload();
    Done...
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    Patience... bronze trophy solidcodes's Avatar
    Join Date
    Jul 2006
    Location
    Philippines
    Posts
    936
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)

    Arrow

    Quote Originally Posted by logic_earth View Post
    Unzip the the Zend archive to some location, probably in the directory of your application. Then include it...
    PHP Code:
    <?php

    require 'path/to/zend/loader.php';
    Zend_Loader::registerAutoload();
    Done...
    @logic_earth thanks but this is my first time of using zend.

    actually i already successfully installed XAMMP and it's running very fine.
    and i downloaded and extracted Zend Framework in the c:\zf directory.
    i also edited the php.ini like this below,

    Code:
    include_path = ".;C:\xampp\php\PEAR;c:\zf\library;c:\zf\bin"
    i run the xampp and called this code below,
    Code:
    % zf create project quickstart
    but unfortunately it doesn't work.

    Now my question is, is my include path is wrong?
    Do i need to put the Zend Framework under XAMPP directory?

    Where did i made wrong?

    Thank you very much in advance.

  4. #4
    SitePoint Guru risoknop's Avatar
    Join Date
    Feb 2008
    Location
    end($world)
    Posts
    834
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can put Zend Framework to any directory on your computer. Just add it to include path and it will work (by using set_include_path() or by editing the php.ini). You can use Zend_Loader to to load the classes, or just old-school __auto_load() which will speed up your applications a bit:

    PHP Code:
    function __autoload($class) {
        include 
    str_replace('_''/'$class) . '.php';


  5. #5
    SitePoint Guru risoknop's Avatar
    Join Date
    Feb 2008
    Location
    end($world)
    Posts
    834
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i run the xampp and called this code below,
    Can't help you with that because I am starting all my ZF projects manually. I have a blank Zend Framework template and I just copy and paste it to a new directory, add a new virtual host and I can start coding.

  6. #6
    SitePoint Guru risoknop's Avatar
    Join Date
    Feb 2008
    Location
    end($world)
    Posts
    834
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    A longer example of set_include_path():

    PHP Code:

    // define BASE_PATH constant
    define('BASE_PATH'dirname(dirname(__FILE__)));

    // define APPLICATION_PATH constant
    define('APPLICATION_PATH'BASE_PATH '/application');

    // set the include path
    set_include_path(BASE_PATH
                     
    '/../../library'
                     
    PATH_SEPARATOR
                     
    get_include_path());

    // autoload classes from the library
    function __autoload($class) {
        include 
    str_replace('_''/'$class) . '.php';

    In this case the Zend folder is placed just outside the www directory in a folder called library. So the path to it is:

    Code:
    C:\wamp\library\Zend
    Document root is in this folder:

    Code:
    C:\wamp\www\myzfproject
    This is the virtual host setup:

    Code:
    NameVirtualHost *:80
    <VirtualHost *:80>
        ServerName myproject
        DocumentRoot "C:\wamp\www\myzfproject"
    </VirtualHost>
    I believe the above code would work also with XAMPP (it has xampp/www document root if I remember correctly).

  7. #7
    SitePoint Evangelist catweasel's Avatar
    Join Date
    Apr 2007
    Location
    Goldfields, VIC, Australia
    Posts
    518
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by solidcodes View Post
    @logic_earth thanks but this is my first time of using zend.

    actually i already successfully installed XAMMP and it's running very fine.
    and i downloaded and extracted Zend Framework in the c:\zf directory.
    i also edited the php.ini like this below,

    Code:
    include_path = ".;C:\xampp\php\PEAR;c:\zf\library;c:\zf\bin"
    i run the xampp and called this code below,
    Code:
    % zf create project quickstart
    but unfortunately it doesn't work.

    Now my question is, is my include path is wrong?
    Do i need to put the Zend Framework under XAMPP directory?

    Where did i made wrong?

    Thank you very much in advance.
    putting \zf\bin in php.ini isn't going to help you with the zf command line tool, you'd need to make sure the zf executable is accessible to your shell environment. I don't use windows but I think it'd be a good idea to google 'zend tool windows' for some tips on setting up zend tool for your machine.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •