首页 > 解决方案 > 无法让 Zend 在 Windows 7 上使用 PHP

问题描述

我无法让 Zend 在使用 IIS 7.5 的 Windows 7 上正常工作。

我设置了 PHP 和 MySQL。这是有效的。

我使用各种语言(ColdFusion、HTML、JSP 等)在各种网站上工作。这些网站都位于文件夹 E:/working 在我的系统上的子文件夹中。然后将 IIS 配置为指向每个网站的相应 subu 文件夹。例如,如果我有文件夹 E:/working/mysite 我将配置 IIS,以便http://127.0.0.1/mysite与该目录相关联并显示主页(index.cfm、index.html或不管它是什么)。

所以对于这个项目,它是 PHP。我有一个 E:/working/myphpsite 目录。这是有效的, http: //127.0.0.1/myphpsite显示位于该目录中的 index.php 文件。

问题是,如果我将 Zend 相关代码放入 index.php 文件中,我会收到以下消息:PHP Fatal error: Class 'Zend\Form\Form' not found in E:\working\myphpsite\index.php on line 8

index.php 文件以这种方式开始:

session_start();

use Zend\Form\Element;
use Zend\Form\Form;

class UploadForm extends Form
{
    public function __construct($name = null, $options = array())
    {
        parent::__construct($name, $options);
       $this->addElements();
}

?>

我的 PHP 目录是 E:/PHP。在那个目录中,我将 zend 文件放在 E:\PHP\includes\ZendFramework\Library\Zend 中。我还更新了 phi.ini 文件部分,如下所示:

;;;;;;;;;;;;;;;;;;;;;;;;;
; Paths and Directories ;
;;;;;;;;;;;;;;;;;;;;;;;;;

; UNIX: "/path1:/path2"
;include_path = ".:/php/includes"
;
; Windows: "\path1;\path2"
include_path = ".;E:\PHP\includes\ZendFramework\Library"

我想我一定遗漏了一些非常明显的东西,但是花了几个小时在互联网上搜索并没有找到任何解决这个问题的方法。

非常感激任何的帮助!

标签: phpzend-frameworkzend-autoloaderspl-autoloader

解决方案


推荐阅读