【问题标题】:Runkit : does not work on a linux serverRunkit:不适用于 linux 服务器
【发布时间】:2009-07-09 15:45:46
【问题描述】:

我在这个小例子中遇到了 PECL::Runkit 的问题

index.php contain <?php
runkit_import('a.php');
runkit_import('b.php');
Doublon::get();

a.php 和 b.php 每个都包含相同的代码

class Doublon
{
static function get() { echo "class " . __FILE__; }
}

在我的 PC 上(Windows XP、Wampserver 2、php 5.2.9-2、runkit DLL 与 Wamp)它工作和 index.php 显示

class C:\wamp2\www\utilitaires\essais\runkit\b.php

在我的 Linux CentOS 5 服务器上,PHP 5.2.10,手动编译的 Runkit

Warning: runkit_import() [function.runkit-import]: class doublon not
found in /shares/public/cedric/test/index.php on line 2
Warning: runkit_import() [function.runkit-import]: Cannot redeclare
class doublon in /shares/public/cedric/test/index.php on line 2
Warning: runkit_import() [function.runkit-import]: class doublon not
found in /shares/public/cedric/test/index.php on line 3
Warning: runkit_import() [function.runkit-import]: Cannot redeclare
class doublon in /shares/public/cedric/test/index.php on line 3
Fatal error: Class 'Doublon' not found in
/shares/public/cedric/test/index.php on line 4

一个问题:runkit 的 make test 给我 100% 的测试失败,但我仍然不知道为什么。 来自 linux 发行版的 runkit 版本只会使 Apache 崩溃: PHP Startup: Timezone database is corrupt

我放弃了xdebug,回到php 5.2.9,但是还是一样的错误

提前致谢,塞德里克

【问题讨论】:

    标签: php runkit


    【解决方案1】:

    The Package site 说:

    WARNING: 0.9 does not compile with PHP 5.2+ so use the CVS version instead.
    

    您使用的是 CVS 版本吗?

    【讨论】:

    • 你在 Windows 上使用 rpm 吗?另外,我不知道为什么你的版本不起作用,但你肯定需要自己编译。
    • 非,Centos 上的 RPM(Redhat 的分支)。我已经编译了 CVS 版本,但它不起作用。
    • hm 很奇怪.. 在那种情况下我不知道.. 我会尝试自己编译它。这真的很简单!假设你已经安装了 PEAR,只需点击:pecl install Runkit-beta
    • 但是我已经自己编译了Runkit,而且是编译后的版本不行。
    【解决方案2】:

    最新的runkit扩展可以在http://github.com/zenovich/runkit找到

    无论如何,据我所知,runkit 从来没有在导入时定义新类的功能。它只能添加或更改现有类的成员。如果你真的想要这个,你可以在http://github.com/zenovich/runkit打开功能请求

    要确定您在平台上得到不同结果的原因,我需要知道它们的 runkit 和 PHP 版本。您可以使用命令 'php -i' 获取所有信息。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-05-16
      • 2013-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-09-03
      • 2012-01-01
      • 1970-01-01
      相关资源
      最近更新 更多