兄弟们,能帮我的PHP环境跑起来吗
程序员文章站
2024-01-13 21:27:22
...
小弟现在用Zend Studio for Eclipse - 6.1.2工具开发zend framework框架的php应用, 能给个详细的步骤不, 现在单独运行php程序是没有问题, 环境一切OK, 主要是现在我想用zend framework框架去开发应用, 环境一直没有搞好, 都不知道怎么弄了。。。。。希望大侠指点指点。
错误提示:
Warning: require_once(Zend/Config.php) [function.require-once]: failed to open stream: No such file or directory in E:\web\haihalie\index.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Config.php' (include_path='.;C:\php5\pear') in E:\web\haihalie\index.php on line 4
我想是不是需要在php.ini文件里面配置一下include_path, 于是找到这个参数,把我的zend Framework框架地址给加进去,配置如下:include_path = ".;D:\Program Files\Zend\Zend Studio for Eclipse -
6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources
\ZendFramework_1.7\FrameworkLib"
会出现如下错误。
Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php:107 Stack trace: #0 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Abstract.php(417): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php(230): Zend_Db_Adapter_Abstract->query('select * from k...', Array) #2 E:\web\haihalie\index.php(37): Zend_Db_Adapter_Pdo_Abstract->query('select * from k...') #3 {main} thrown in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php on line 107
搞不清楚了, 希望大侠指点一二。
回复讨论(解决方案)
这种情况建议查看zend framework框架的配置相关手册,和开发工具关系不大。
看看有没zend framework的插件,我好久没用过zend 工具了.你想要他框架代码提示吧?
Zend Studio for Eclipse - 6.1.2工具自带了zend framework的plug, require,代码提示都可以正常, 就是你调用Zend Framework的Class就会提示错误,
我的测试代码:
require_once 'Zend/Config.php'; require_once 'Zend/Db.php'; require_once 'Zend/Date.php'; // 数据库配置信息 $configArray = array( 'webhost' => 'www.example.com', 'database' => array( 'adapter' => 'pdo_mysql', //注意,你的PHP需要支持这个扩展,也可以换成其他类型的扩展 'params' => array( 'host' => 'localhost', 'username' => 'root', 'password' => 'admin', 'dbname' => 'krhm' ) ) ); // 将配置信息对象化 $config = new Zend_Config($configArray); // 打印其中一个属性值 echo $config->webhost; // 读取配置信息,建立数据库链接 $db = Zend_Db::factory($config->database); // 设置数据链接语言 //$db->query('SET NAMES GBK'); // 查询数据库保存的内容 $sql = "select * from kr_sys_user"; $result = $db->query($sql); // 使用PDOStatement对象$result将所有结果数据放到一个数组中 $rows = $result->fetchAll(); print_r($rows);
错误提示:
Warning: require_once(Zend/Config.php) [function.require-once]: failed to open stream: No such file or directory in E:\web\haihalie\index.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'Zend/Config.php' (include_path='.;C:\php5\pear') in E:\web\haihalie\index.php on line 4
我想是不是需要在php.ini文件里面配置一下include_path, 于是找到这个参数,把我的zend Framework框架地址给加进去,配置如下:include_path = ".;D:\Program Files\Zend\Zend Studio for Eclipse -
6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources
\ZendFramework_1.7\FrameworkLib"
会出现如下错误。
Fatal error: Uncaught exception 'Zend_Db_Adapter_Exception' with message 'The PDO extension is required for this adapter but the extension is not loaded' in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php:107 Stack trace: #0 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Abstract.php(417): Zend_Db_Adapter_Pdo_Abstract->_connect() #1 D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php(230): Zend_Db_Adapter_Abstract->query('select * from k...', Array) #2 E:\web\haihalie\index.php(37): Zend_Db_Adapter_Pdo_Abstract->query('select * from k...') #3 {main} thrown in D:\Program Files\Zend\Zend Studio for Eclipse - 6.1.2\plugins\org.zend.php.framework.resource_6.1.2.v20090318-1524\resources\ZendFramework_1.7\FrameworkLib\Zend\Db\Adapter\Pdo\Abstract.php on line 107
搞不清楚了, 希望大侠指点一二。
pdo扩展没装。装一下php的pdo。
跟框架、开发工具没有关系,pdo扩展没有打开,到php.ini中把pod相关的扩展打开,重启Apache或Nginx...
跟框架、开发工具没有关系,pdo扩展没有打开,到php.ini中把pod相关的扩展打开,重启Apache或Nginx...
pdo,不是pod