Ubuntu 10.04 中正常运行AMFPHP

相应大家在使用AMFPHP进行FLASH与PHP的通讯的时候,可能会遇到很多问题:
如php版本的原因,因为里面有很些代码在书写的时候,没有注意到,也无法及时更新上PHP版本和一些function的更新,如会经常提示的:

Function eregi_replace() is deprecated

当出现这种错误的时候,更多的是因为PHP的版本的原因。PHP5.3无法支持你的这个function了,所以您不得不通过支持的 function来替换掉他们。

修改/amfphp/core/shared/util/MethodTable.php 文件:

$comment = eregi_replace("\n[ \t]+", "\n", trim($comment));
        $comment = str_replace("\n", "\\n", trim($comment));
$comment = eregi_replace("[\t ]+", " ", trim($comment));

改成下面的内容。就正确了

$comment = preg_replace("#\n[ \t]+#U", "\n", trim($comment));
        $comment = str_replace("\n", "\\n", trim($comment));
$comment = preg_replace("#[\t ]+#U", " ", trim($comment)); 

还有另外一种方法,也就是你实在不想使用php 5.3的话,也是可以把在Ubuntu 10.04中把您的版本修改为php 5.2也是一种很好的选择方法的。
那你直接使用以下方法来进行吧
http://wiki.ubuntu.org.cn/PHP5.2
http://wiki.ubuntu.org.cn/Apache 
要注意你在更新的时候,是使用aptitude 还是 apt-get install
相信有很多方法可以帮助我们正常的运行,要思考。学习!

猜你喜欢

转载自phpedu.iteye.com/blog/805545
今日推荐