简体   繁体   English

Include在生产服务器上的phar存档内失败,但在本地dev服务器上未失败

[英]Include is failing inside phar archive on production server but not on local dev server

The error given is 给出的错误是

include(): Failed opening 'phar:///var/www/vhosts/redsoftware.us/assets/RedSoftware/app/libs/goutte/goutte.phar/_cli_stub.php' for inclusion (include_path='phar:///var/www/vhosts/redsoftware.us/assets/RedSoftware/app/libs/goutte/goutte.phar:.:') 

It seems like the phar archive is being loaded but when it tries to include some asset it fails. 似乎phar归档文件正在加载,但是当它尝试包含某些资产时会失败。 I'm at a loss as to where to even start troubleshooting this. 我不知道该从哪里开始进行故障排除。 It works perfectly on my local machine but when I upload it to the production server (running plesk if it matters) it fails. 它可以在我的本地计算机上完美运行,但是当我将其上传到生产服务器(如果需要运行plesk)时,它将失败。

Phar seems to be enabled. Phar似乎已启用。 From phpinfo(): 从phpinfo():

Registered PHP Streams 注册的PHP流

https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, http, ftp, phar , zip https,ftps,compress.zlib,compress.bzip2,php,文件,glob,数据,http,ftp, phar ,zip

Any ideas what could be causing this? 任何想法可能是什么原因造成的?

The problem I was having here stems from older versions of Ioncube having issues with phar archives. 我在这里遇到的问题源于Ioncube的较早版本在phar档案方面存在问题。

Excerpt from http://silex.sensiolabs.org/doc/usage.html#pitfalls : 摘录自http://silex.sensiolabs.org/doc/usage.html#pitfalls

Ioncube loader is an extension that can decode PHP encoded file. Ioncube loader是可以解码PHP编码文件的扩展。 Unfortunately, old versions (prior to version 4.0.9) are not working well with phar archives. 不幸的是,旧版本(4.0.9之前的版本)无法与phar档案一起正常工作。 You must either upgrade Ioncube loader to version 4.0.9 or newer or disable it by commenting or removing this line in your php.ini file: 您必须将Ioncube加载程序升级到4.0.9或更高版本,或者通过注释或删除php.ini文件中的这一行来禁用它:

zend_extension = /usr/lib/php5/20090626+lfs/ioncube_loader_lin_5.3.so

Thanks to @Maerlyn for liking to that article. 感谢@Maerlyn喜欢这篇文章。

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

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