Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to configure Zend Framework for Ubuntu10.10

Shulou Source: shulou.com Published: 2022-06-01 12:25:49 11月26日 Update

This article introduces the knowledge of "how to configure Zend Framework in Ubuntu10.10". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The first step is to open the rewrite module of apache, because you must perform this step when using apache under UBUNTU

The code is as follows:

Sudo a2enmod rewrite # activate rewrite module

Restart the apache server after sudo / etc/init.d/apache2 restart # activation

Step 2: install Zend Framework

The code is as follows:

Sudo apt-get install zend-framework

The system automatically installs dependency packages, including bin and php5-cli. The location of the Zend library is located in the / usr/share/php/libzend-framework-php directory after a successful installation.

The third step is to configure include_path path information. Modify the zend-framework.ini in the / etc/php5/conf.d directory, remove the semicolon before include_path, save and exit.

The fourth step is to create a web application using the zf command. Enter the command line in the / usr/bin directory and type

The code is as follows:

Sudo zf create project

After that, pop up and enter the project path (arrange the project path according to your preference), and find some subdirectories such as application public under the specified directory, thus successfully creating a ZF-based web application. My project name here is ZFTest.

The fifth step is to configure apache information about the project. Because the default web directory of apache is under / var/www, in order to enable apache to automatically locate the web application in the specified directory, here we create a configuration file about ZFTest in / etc/apache2/conf.d, called zftest.conf. The contents of the document are:

The code is as follows:

Alias / zftest "/ home/" xxx "/ ZFTest/public/"

Allow from all

RewriteEngine on

RewriteBase / zftest

RewriteCond% {REQUEST_FILENAME}!-f

RewriteRule!\. (css | js | jpg | gif | png | swf | flv) $index.php

Options FollowSymlinks MultiViews

AllowOverride All

Step six, modify the .htaccess file in public. .htaccess is a hidden file, which can be hidden by viewing-showing. The contents of the document are as follows:

The code is as follows:

RewriteEngine On

RewriteBase / zftest

RewriteCond% {REQUEST_FILENAME}-s [OR]

RewriteCond% {REQUEST_FILENAME}-l [OR]

RewriteCond% {REQUEST_FILENAME}-d

RewriteRule ^. * $- [NC,L]

RewriteRule ^. * $index.php [NC,L]

Step 7, restart the apache server

The code is as follows:

Sudo / etc/init.d/apache2 restart

Open http://127.0.0.1/zftest display

The code is as follows:

Welcome to the Zend Framework!

This is your project's main page

Even if the configuration is successful.

This is the end of the content of "how to configure Zend Framework for Ubuntu10.10". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Configuration code file directory content success path project application information command more server module activation knowledge service input utility learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MariaDB MySQL Shulou Technology Shulou Tech Info NVidia