How to setup First Application in Zend Framework 2

后端 未结 7 800
一向
一向 2020-12-30 02:57

i am creating my first application in zf2. i followed Zend Offical website zf2 Skeleton Application.i have downloaded the skeleton app from github as in in the given link.wh

相关标签:
7条回答
  • 2020-12-30 03:10

    its seems like you have not Downloaded the zf2 :) download it from here http://framework.zend.com/downloads/latest#ZF2

    extract the framework to vendor/ZF2. and you done :) now browse to your app hope it showing No Exception.

    0 讨论(0)
  • 2020-12-30 03:13

    In addition to Rob Allens answer i have good responses so far from Windows User who have less experience with the command line.

    You may find my blog helpful, too: Zend Framework 2 installation on Xampp for Windows

    0 讨论(0)
  • 2020-12-30 03:18

    You should open a cmd window and change directory to your project. You then need to type the following:

    php composer.phar install
    

    This will install all the library dependencies for the Zend Skeleton Application - ZF2 in this case.

    0 讨论(0)
  • 2020-12-30 03:19

    1.Enable LoadModule rewrite_module modules/mod_rewrite.so from your apache

    2.Enable extension=php_openssl.dll from your php.ini

    3.Install Composer from http://getcomposer.org/doc/00-intro.md#autoloading. There are instructions for both Linux and windows.

    4.Download skeleton project from github.( https://github.com/zendframework/ZendSkeletonApplication and click the “Zip” button) to your htdocs.

    5.Go to the directory where you have just downloaded the skeleton project.

    6.Run php composer.phar install.This will download all the dependencies.

    7.Go to http://framework.zend.com/manual/2.2/en/user-guide/skeleton-application.html and create a virtual host accordingly.

    <VirtualHost *:80>
      ServerName zf2-tutorial.localhost
    DocumentRoot /path/to/zf2-tutorial/public
    SetEnv APPLICATION_ENV "development"
    <Directory /path/to/zf2-tutorial/public>
        DirectoryIndex index.php
        AllowOverride All
        Order allow,deny
        Allow from all
    </Directory>
    

    8.Go to c:\windows\system32\drivers\etc\hosts (Windows)or /etc/hosts(Linux) and add the following lines: 127.0.0.1 zf2-tutorial.localhost localhost

    9.Go to http://zf2-tutorial.localhost/ and you should see the welcome page.

    0 讨论(0)
  • 2020-12-30 03:25

    How about making it easier @Rob Allen? When answering, so that other reader can save 24 hours to 1 minute !! I tried to make it easier from your answer as below:

    1) httpd.conf
    <VirtualHost *:80>
     ServerName site
     ServerAlias site
     DocumentRoot /var/www/html/s/public
     <Directory /var/www/html/s/public>
        #AddDefaultCharset utf-8
        DirectoryIndex index.php
        AllowOverride FileInfo
        Order allow,deny
        Allow from all
     </Directory>
    </VirtualHost>
    
    2) i did git clone git repo
    $ ls
    composer.json  composer.lock  composer.phar  config  data  db_bck  init_autoloader.php  LICENSE.txt  module  nbproject  public  README.md  vendor
    
    3) I run and i get same error
    
    4) I did now this
    
    $ php composer.phar install
    Loading composer repositories with package information
    Installing dependencies from lock file
      - Installing zendframework/zendframework (2.0.6)
        Downloading: 100%         
    
        Skipped installation of bin/classmap_generator.php for package zendframework/zendframework: name conflicts with an existing file
    zendframework/zendframework suggests installing doctrine/common (Doctrine\Common >=2.1 for annotation features)
    zendframework/zendframework suggests installing ext-intl (ext/intl for i18n features)
    zendframework/zendframework suggests installing pecl-weakref (Implementation of weak references for Zend\Stdlib\CallbackHandler)
    zendframework/zendframework suggests installing zendframework/zendpdf (ZendPdf for creating PDF representations of barcodes)
    zendframework/zendframework suggests installing zendframework/zendservice-recaptcha (ZendService\ReCaptcha for rendering ReCaptchas in Zend\Captcha and/or Zend\Form)
    Generating autoload files
    
    
    5) It works now
    
    0 讨论(0)
  • 2020-12-30 03:25

    As you have already downloaded the GIT file Below commands are for windows :

    1) Go to the respective folder 2) run the command -> composer update 3) That should let you install and choose optional modules 4) Finally -> php -S 0.0.0.0:8080 -t .\public .\public\index.php

    With this you should be able to access the index page at http://localhost:8080/

    0 讨论(0)
提交回复
热议问题