手机
当前位置:查字典教程网 >操作系统 >Ubuntu/Debian >Ubuntu 10.10 配置 Zend Framework
Ubuntu 10.10 配置 Zend Framework
摘要:第一步,打开apache的rewrite模块,因为在UBUNTU下使用apache必须执行这一步sudoa2enmodrewrite#激活r...

第一步,打开apache的rewrite模块,因为在UBUNTU下使用apache必须执行这一步

sudo a2enmod rewrite #激活rewrite模块

sudo /etc/init.d/apache2 restart #激活后要重启apache服务器

第二步,安装Zend Framework

sudo apt-get install zend-framework

系统会自动安装依赖包,包括bin还有php5-cli。成功安装后Zend库的位置位于/usr/share/php/libzend-framework-php目录下。

第三步,配置include_path路径信息。修改/etc/php5/conf.d目录下的zend-framework.ini,将include_path前的分号去掉,保存并退出。

第四步,使用zf命令创建web应用。命令行进入/usr/bin目录下,输入

sudo zf create project

后,弹出输入项目路径(根据喜好,安排项目的路径),发现在指定的目录下出现了一些子目录application public等,这样就成功创建了基于ZF的web应用。这里我的项目名称是ZFTest。

第五步,配置apache关于本项目的信息。因为apache默认的web目录是在/var/www下,为了能够让 apache自动定位到指定目录下的web应用,这里我们在/etc/apache2/conf.d中创建一个关于ZFTest的配置文件,称为 zftest.conf。文件的内容是:

<IfModule alias_module>

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

<Directory "/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

</Directory>

</IfModule>

第六步,修改public里的.htaccess文件。.htaccess是隐藏文件,可通过查看-显示隐藏文件。文件内容如下:

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]

第七步,重启apache服务器

sudo /etc/init.d/apache2 restart

打开http://127.0.0.1/zftest显示

Welcome to the Zend Framework!

This is your project's main page

就算配置成功了。

【Ubuntu 10.10 配置 Zend Framework】相关文章:

Ubuntu 8.10 Intrepid Ibex Alpha4 官方正式版下载

Ubuntu(Linux)下配置IP地址的方法

Ubuntu 11.04下搭建android开发环境

ubuntu13.04设置root权限详解

Ubuntu 8.10 Server Ruby 的安装方法

Ubuntu 9.10安装开启3D桌面特效[多图]

在Ubuntu Server是配置iptables防火墙

Ubuntu中配置Mysql编码的具体步骤

Ubuntu 14.10上安装新的字体图文教程

Ubuntu Server下配置UTF-8中文/英文环境的方法

精品推荐
分类导航