繁体   English   中英

php5-FPM错误,同时包含多个phar文件

[英]Php5-FPM error while including multiple phar files

我们在服务器上使用Ubuntu + nginx + php5-fpm组合,PHP版本为5.5。 我们正在尝试运行index.php,其中包含一堆phar文件。 就像是:

<?php
include "a.phar";
include "b.phar";
//...
?>

当从命令行PHP运行此脚本时,它可以正常工作。 从php开发服务器(php -S)或nginx运行此命令时,会出现以下错误:

2013/11/18 17:56:06 [error] 14384#0: *597 FastCGI sent in stderr: "PHP message: PHP Fatal error:  Cannot redeclare class Extract_Phar in b.phar on line 103

我没有一个称为Extract_Phar的类-因此我想我的构建过程会将其添加到过程中的某个位置。 我已经使用phing构建了相同的内容,以防万一。 定位目标是:

<target name="phar" depends="prepare">
  <pharpackage destfile="./build/phar/LogUtils.phar" 
  basedir="./build/intophar"
  compression="bzip2">
  <fileset dir="./build/intophar/">
    <include name="*.*" />
    <include name="**/**" />
  </fileset>
  <metadata>
    <element name="version" value="1.0" />
    <element name="authors">
       <element name="Shreeni">
         <element name="e-mail" value="test@test.com" />
       </element>
    </element>
  </metadata>
  </pharpackage>
</target>

我的intophar文件夹中的index.php类似于:

include("api/LogUtils.inc.php");
// Other relative include statements

我根据其他答案玩过apc标志,并设置了以下内容:

apc.include_once_override = 0 
apc.canonicalize = 0 
apc.stat = 0
apc.enabled=0 
apc.enabled_cli=0
apc.cache_by_default = 0

这些都无济于事,我们无法运行我们的代码。 有什么建议么?

该问题可能是由于各种phar文件中的存根冲突而发生的。 尝试:

<?php
include "phar://a.phar/index.php"; // Assuming that the stub is index.php
include "phar://b.phar/index.php"; // Assuming that the stub is index.php
//...
?>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM