编程语言
首页 > 编程语言> > 该行的功能如何:require_once(‘Zend / Registry.php’);?

该行的功能如何:require_once(‘Zend / Registry.php’);?

作者:互联网

我在win 7上安装了Zend Framework 2(Zend Framework Zend Server).
在Zend / Apache2 / htdocs / hello1.php中,我输入以下脚本:

<?php
    require_once('Zend/Registry.php'); 
    $registry = Zend_Registry::getInstance(); 
    $registry['name'] = 'Quentin Zervaas'; 
    echo sprintf('My name is %s', $registry['name']);
?>

然后我运行http://localhost/hello1.php,它显示:
我叫Quentin Zervaas

我的问题是:
对于这一行require_once(‘Zend / Registry.php’);在htdocs文件夹下,它是dummy.php,favicon.ico,index.html,hello1.php,
没有Zend文件夹,那么此行的功能如何?

解决方法:

在你的php.ini中检查一下

include_path 

它将具有zend目录的默认位置.

标签:zend-framework2,php
来源: https://codeday.me/bug/20191031/1972221.html