Zend Framework installation

Discussion in 'PHP' started by narekm, Jun 15, 2011.

  1. narekm

    narekm New Member

    Joined:
    Mar 23, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Hello there..I am so desparate...I spent almost my whole day trying to install "Zend" called framework but without any result..I have explored some articles but cant follow along because they are written for not beginner learners..Please can you suggest some articles where all instllation process is explained clearly..

    I have XAMPP installed on my windows XP ..So i want Zend to be installed in XAMPP..Please be gentle and help me in this chaos!!
     
  2. pein87

    pein87 Active Member

    Joined:
    Aug 6, 2010
    Messages:
    173
    Likes Received:
    47
    Trophy Points:
    28
    Occupation:
    Web Dev
    Location:
    Limbo
    I'm downloading it now but I have to go to the store, I'll reply with how to do it once I've returned.
     
    narekm likes this.
  3. pein87

    pein87 Active Member

    Joined:
    Aug 6, 2010
    Messages:
    173
    Likes Received:
    47
    Trophy Points:
    28
    Occupation:
    Web Dev
    Location:
    Limbo
    This is for windows only

    download zendframework

    unzip or uncompress the zip or tar file

    go to your xampp's htdocs folder

    rename the zend folder to simply zend

    move the zend folder to your htdocs folder

    open the zend folder and you should see a library folder( if you see zendframework -[version number here] rename that folder to zends and right click it an pick cut.. go back to htdocs folder and right click and pick paste. Delete the zend folder and rename the zends to zend.)

    go to the php folder of your xampp folder(usually C:\xampp\php) and edit the php.ini file

    search for include_path and added the path to your zend's library folder

    mine looked like this when I found it

    Code:
    include_path = ".;C:\xampp\php\PEAR\"
    now it looks like this

    Code:
    include_path = ".;C:\xampp\php\PEAR\;C:\xampp\htdocs\zend\library"
    notice the paths are separated with a ;

    restart xampp

    next open a cmd prompt and change the directory to your zend's bin folder or type

    Code:
    cd C:\xampp\htdocs\zend\bin
    next type

    Code:
    zf.bat create project project_name_here
    if no errors it created your new project, if you get php.exe is not a command change the %PATH% to include C:\xampp\php and it should work after that.
     
    narekm likes this.
  4. narekm

    narekm New Member

    Joined:
    Mar 23, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    Hello pein87 tx very much .But i only lack one thing..as you said after typing
    it might say
    I had that situation but for the solution to that problem you have typed
    but which path you meant ? and what is that "%" sign ..So i have done all above you dictated apart from the last as i explained..Please help finally sort this out...Thx oce more for your time explaining everything very clearly..
     
  5. narekm

    narekm New Member

    Joined:
    Mar 23, 2011
    Messages:
    14
    Likes Received:
    0
    Trophy Points:
    0
    And please one more thing..As i trying to install zend according to the way you tell me ..after compliting the installation(after you my question above ) I would like you to tell me hove can i include zend frameworks files to my php file and start working with them...So i mean can you give me a sample of code of zend framework that i can run using htdocs\ZendTest.php file so i can make sure that it works in the way it is supposed to!!!Thx very much!!!
     
  6. pein87

    pein87 Active Member

    Joined:
    Aug 6, 2010
    Messages:
    173
    Likes Received:
    47
    Trophy Points:
    28
    Occupation:
    Web Dev
    Location:
    Limbo
    This site has a good tut on how to do it

    http://banagale.com/changing-your-system-path-in-windows-vista.htm

    add
    Code:
    C:\xampp\php
    to the environment path

    as for that just include the desired file, you really don't need to install it, that just so it creates a new project thats blank which you can use as the base for your project.

    go to control panel

    go to system and maintenance

    on the left side it should say advanced settings click it

    a pop up should come up, now at the bottom it should have a button that says system variables or something similar

    when the prompt comes up click on the new button where it says system variables(it will be the bottom set of boxes the top ones are just for your user)

    name it
    Code:
    zend
    and give it the value of
    Code:
    C:\xampp\php
    and click ok.

    Now open a new cmd and type
    Code:
    cd C:\xampp\htdocs\zend\bin
    then type
    Code:
    zf.bat create project name_here
    this should now work for the cmd tool, then include the files you need to use, see zend quick start as well as I'm not familiar with it.

    http://framework.zend.com/manual/en/learning.quickstart.create-project.html

    also try these, which I found on the zend site and owned by the original poster

    Code:
    Error 1 occurred while trying to create my project from the command prompt.
    This error occurrs becuase windows does not know where to look for zf.bat.
    
    C:\zendSites>zf create project quickstart
    'zf' is not recognized as an internal or external command, operable program or batch file.
    
    action: add the zf.bat path to windows xp environment variables...
    right click mycomputer>>properties>>advanced>>environment variables>>
    then highlight "path" in the list of system variables and click edit
    in my case i added ";c:\zend\bin" (without quotes) to the end of the list
    note that the leading semicolen is the path separator.
    restart computer.
    
    --------------------
    
    Error 2 occurred while trying to create my project from the command prompt and after adding the zf.bat path to windows environment variables. This error occurrs because windows does not know how to execute php scripts. It needs to know the path to php.exe
    
    C:\zendSites>zf create project quickstart
    '"php.exe"' is not recognized as an internal or external command,
    operable program or batch file.
    
    action: add the php.exe path to the windows environment variables.
    same as above, but this time i'm adding the path ;C:\wamp\bin\php\php5.3.0
    don't forget to restart your computer
    
    --------------------
    
    Expanded explanation of creating a virtual host on windows running wamp server 2.0
    
    open httpd.conf (click on the wamp icon in the services>>apache>>httpd.conf)
    find and uncomment the line: #Include conf/extra/httpd-vhosts.conf by removing the # sign go to C:\wamp\bin\apache\Apache2.2.11\conf\extra\ and open httpd-vhosts.conf note the "Apache2.2.11" in the above path. obviously this is version specific.
    
    add the following block of code to the end of httpd-vhosts.conf...
    
    <VirtualHost *:80>
    DocumentRoot "c:\zendSites\quickstart\public"
    ServerName quickstart.local
    SetEnv APPLICATION_ENV "development"
    <Directory c:\zendSites\quickstart\public>
    DirectoryIndex index.php
    AllowOverride All
    Order allow,deny
    Allow from all
    </Directory>
    </VirtualHost>
    
    <VirtualHost *:80>
    DocumentRoot C:\wamp\www
    ServerName localhost
    </VirtualHost>
    
    ...after adding this block of code you will need to update your windows hosts file, which maps requested urls to the server. go to C:\WINDOWS\system32\drivers\etc and open the hosts file. add the following 2 lines to the bottom of the file...
    
    127.0.0.1 localhost
    127.0.0.1 quickstart.local
    
    ...now restart your wamp server.
    
    notice the entries for localhost. this is to preserve localhost paths like that for phpmyadmin
    note, that now you have done this your address will be quickstart.local so any reference in the tutorial that says to go to http://localhost should be replaced now by http://quickstart.local
    this page will not be found by requests outside the local computer. ie. you will not be online until you register with a DNS (beyond the scope of this material)
    
    -------------------------
    
    Error 3
    Internal Server Error 
    The server encountered an internal error or misconfiguration and was unable to complete your request.
    
    after making the changes above you will likely get this error In this case the error is caused becuase appache does not have the rewrite module enabled
    action:
    click on the wamp server icon in the services portion of the windows task bar.
    apache>>apache modules>>scroll down to "rewrite_module" and click it.
    wamp should restart automatically
    
    ----------------------------
    
    Error 4
    Warning: require_once(Zend/Application.php) [function.require-once]: failed to open stream: No such file or directory in C:\zendSites\quickstart\public\index.php on line 18
    Fatal error: require_once() [function.require]: Failed opening required 'Zend/Application.php' (include_path='C:\zendSites\quickstart\library;.;C:\php5\pear') in C:\zendSites\quickstart\public\index.php on line 18
    
    at this point if you have not set your include_path in php.ini you will recieve the above error.
    
    action:
    click the wamp server icon in the services section of the windows taskbar>>php>>php.ini
    now change the following section...
    
    ; Windows: "\path1;\path2"
    ; include_path = ".;c:\php\includes"
    
    to...
    
    ; Windows: "\path1;\path2"
    include_path = ".;c:\php\includes;c:\zend\library"
    
    ...and restart the wamp server again
    
    
    -----------------------------
    Error 5
    'dbname' is not recognized as an internal or external command,
    operable program or batch file.
    
    cmd input/output:
    C:\zendSites\quickstart>zf configure db-adapter 'adapter=PDO_SQLITE&dbname=APPLICATION_PATH "/../data/db/guestbook.db"' production
    A db configuration for the production section has been written to the application config file.
    'dbname' is not recognized as an internal or external command,
    operable program or batch file.
    
    this has to do with the difference between how linux and windows systems intrepret quotation marks.
    so you will need to change...
    
    zf configure db-adapter 'adapter=PDO_SQLITE&dbname=APPLICATION_PATH "/../data/db/guestbook.db"' production
    
    to...
    
    zf configure db-adapter "adapter=PDO_SQLITE&dbname=APPLICATION_PATH '/../data/db/guestbook.db'" production
    
    --------------------------------
    
    when creating load.sqlite.php, data.sqlite, schema.sqlite.sql make sure that the scripts folder that holds them is at the same level as the application folder. ie. c:\zendSites\quickstart\scripts
    also make sure that the load.sqlite.php code from framework.zend.com is enclosed with the php tags (<?php ?>). when you run this script from the prompt make sure you run it from the quickstart path
    
    --------------------------------
    
    Error 6
    C:\zendSites\quickstart>php scripts\load.sqlite.php --withdata
    PHP Warning: require_once(Zend/Loader/Autoloader.php): failed to open stream: No such file or directory in C:\zendSites\quickstart\scripts\load.sqlite.php
    
    this was a tricky one. It occurrs when we try to run the load.sqlite.php script because the command prompt uses a different php.ini than apache. you need to navigate to...
    
    C:\wamp\bin\php\php5.3.0\php.ini
    
    now change the following section...
    
    ; Windows: "\path1;\path2"
    ; include_path = ".;c:\php\includes"
    
    to...
    
    ; Windows: "\path1;\path2"
    include_path = ".;c:\php\includes;c:\zend\library"
    
    ...and restart the wamp server again
     
    Last edited: Jun 19, 2011
  7. sasha_design

    sasha_design New Member

    Joined:
    Jan 27, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    I has some question. I install zend framework in my local webserver. Than I create in cmd test site. Site create, but in the process of site creating cmd type me:

    C:\WebServers\home>zf.bat create project myfirst
    Creating project at C:/WebServers/home/myfirst
    Note: This command created a web project, for more information setting up your V
    HOST, please see docs/README
    Testing Note: PHPUnit was not found in your include_path, therefore no testing a
    ctions will be created.

    Then, when I type:

    C:\WebServers\home\myfirst>zf create action add index

    cmd type me:

    'zf' is not recognized as an internal or external command,
    operable program or batch file.
     
  8. sasha_design

    sasha_design New Member

    Joined:
    Jan 27, 2012
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Web server`s name - Denwer
     
  9. rparedes

    rparedes New Member

    Joined:
    Aug 1, 2012
    Messages:
    1
    Likes Received:
    0
    Trophy Points:
    0
    Hello there..I am so desparate...I spent almost my whole day trying to put online wamp server, but it doesnt go up, some days ago I was working fine. I already uninstalled skype and check the IIS is not running, but Wamp server doesnt go up.
    Waht can I do?
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice