English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

Method to Establish ZF Project Based on Command Line in Zend Framework

This article describes the method of establishing ZF projects based on Command line in Zend Framework. Shared for everyone's reference, as follows:

The project structure of Zend Framework is relatively complex, but there is a fixed structure. ZF provides a tool for generating project structures using Command, which is very convenient, and beginners do not have to be overwhelmed by the complex structure.

Some configurations before use.

Files involved:

1.the 'library' of 'zf'

2.bin, the 'bin' folder included in the 'zf' download

3.php.exe

Step 1:

Copy the 'library' and 'bin' folders to the root directory of the server, the root directory of my server is E:\wamp\www

Step 2:

Set the environment variable by modifying the 'Path' value in the system variables. Add the path of the 'bin' folder and the directory where 'php.exe' is located, I added E:\wamp\bin\php\php5.2.6;E:\wamp\www\bin (two paths separated by semicolons).

Modifying the environment variable is to enable the use of the 'zf' command in any file directory when using cmd. Without the environment variable, the 'zf' command can only be used in the 'bin' directory, and if the directory of 'php.exe' is not in the environment variable, it cannot be executed.

Step 3 (not required)

If you have followed the first two steps, you can skip this step. If, your bin directory and lirary directory are not placed as above, you need to modify the zf.php file in the bin directory.

$zfIncludePath['relativePath'] = dirname(__FILE__) .'/../library/;

Modify the relative path so that the zf command can find the lirary folder.

OK, open cmd, enter zf show version, if the output is your zf version. Congratulations, you have set it up successfully.

1. If the output is 'zf' is not an internal or external command….

2. If the output is 'ZF ERROR….', check your bin/Check if the directory of lirary in the zf.php file is correct.

Let's create the project below:

Enter the directory where you want to create the project, usually the root directory of the server E:\wamp\www. Enter

zf create project yourProjectName

Alright, enjoy the zf command.

Readers who are interested in more about zend-related content can check the special topic of this site: 'Zend FrameWork Framework Introduction Tutorial', 'Summary of Excellent php Development Frameworks', 'Introduction and Common Skills Summary of Yii Framework', 'ThinkPHP Introduction Tutorial', 'Introduction to php Object-Oriented Program Design', 'php'+Introduction to mysql database operation tutorial and Summary of common php database operation skills

I hope the description in this article will be helpful to everyone for PHP program design based on the Zend Framework.

Statement: The content of this article is from the Internet, and the copyright belongs to the original author. The content is contributed and uploaded by Internet users spontaneously. This website does not own the copyright, has not been manually edited, and does not assume any relevant legal liability. If you find any content suspected of copyright infringement, please send an email to: notice#w3Please report via email to codebox.com (replace # with @) and provide relevant evidence. Once verified, this site will immediately delete the infringing content.

You May Also Like