2011-10-30 54 views
1

我一直在尝试将zend框架与xampp集成。但无法实现任何事情。Zend Framework与XAMPP集成

E:\Program Files\XAMPP\xampp\php\PEAR 

从上述路径

目前Zend框架可删除我的Zend库中

G:\ZendFramework-1.11.11\ZendFramework-1.11.11 

我也试图从

G:\ZendFramework-1.11.11\ZendFramework-1.11.11\library 

添加Zend库
E:\Program Files\XAMPP\xampp\htdocs\testproject\library 

但是,仍然每当我只是想通过这个网址

http://localhost:85/testproject/public/ 

我打开我的页面欢迎的输出zendframework

但是,每当我只是尝试打开其中i使用的任何页面Zend库就像Zend_Form的话,我得到一个异常

Fatal error: Class 'Zend_Form' not found in E:\Program Files\XAMPP\xampp\htdocs\testproject\public\Guestbook.php on line 15 

我也更新我的php.ini文件,并恢复了我的include_path这

include_path = ".;E:\Program Files\XAMPP\xampp\php\PEAR;G:\ZendFramework-1.11.11\ZendFramework-1.11.11\library\" 

紧急帮助将不胜感激

我的操作系统是Windows 7

当我输入的命令PHP -v然后回到我

PHP 5.3.0 (cli) (built: Jul 2 2009 21:08:11) 
Copyright (c) 1997-2009 The PHP Group 
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies 

和ZF显示版本返回我

zf show version 
Zend Framework Version: 1.11.11 

XAMPP版本是1.7.2

Appache版本是:

Apache/2.2.12 (Win32) DAV/2 mod_autoindex_color PHP/5.3.0 mod_perl/2.0.4 Perl/v5.10.0 

index.php文件

<?php 
// Set the initial include_path. You may need to change this to ensure that 
// Zend Framework is in the include_path; additionally, for performance 
// reasons, it's best to move this to your web server configuration or php.ini 
// for production. 
set_include_path(implode(PATH_SEPARATOR, array(
    realpath(dirname(__FILE__) . '/../library'), 
    get_include_path(), 
))); 

// Define path to application directory 
defined('APPLICATION_PATH') 
    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application')); 

// Define application environment 
defined('APPLICATION_ENV') 
    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production')); 

/** Zend_Application */ 
require_once 'Zend/Application.php'; 

// Create application, bootstrap, and run 
$application = new Zend_Application(
    APPLICATION_ENV, 
    APPLICATION_PATH . '/configs/application.ini' 
); 
$application->bootstrap(); 
$application->run(); 
    enter code here 

.htaccess文件

SetEnv APPLICATION_ENV development 

RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ - [NC,L] 
RewriteRule ^.*$ index.php [NC,L] 
+1

你试过,你创建项目后,把Zend框架库在你的项目的库文件夹? –

+0

是的,我已经这么做了 –

+0

我不明白的是你为什么要做所有这些事情。要让ZF工作,您只需安装XAMP,将ZF解压缩文件夹放入本地主机,运行zf.bat创建项目,然后将ZF库复制/粘贴到项目文件夹中。之后,你必须改变一个规则到你的http.conf中,那就是将AllowOverride None更改为AllowOverride全部 –

回答

0

也许这可以帮助我我使用EasyPhp(而不是XAMPP) 和Zend的自动生成的.htaccess和我有这个在阿帕奇

NameVirtualHost 127.0.0.1:80 

<VirtualHost abc:80> 
DocumentRoot "C:/www/www/abc/public" 
ServerName .local 
SetEnv APPLICATION_ENV development 
<Directory "C:/www/www/abc/public"> 

    Options Indexes MultiViews FollowSymLinks 

    AllowOverride All 

    Order allow,deny 

    Allow from all 
</Directory> 

</VirtualHost> 

,这是该目录的样子

Directory di c:\www\www\abc 

[.]    [..]    .buildpath  .project 
[.settings]  .zfproject.xml [application] [cache] 
[data]   [docs]   [library]  [public] 
[scripts]  [tests] 

Directory di c:\www\www\abc\library 

[.]   [..]   [abc] [tcpdf]  [Zend]  [ZendX]