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

StackOverflow https://stackoverflow.com/questions/9140148

  •  22-04-2021
  •  | 
  •  

質問

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. 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.

Phar seems to be enabled. From phpinfo():

Registered PHP Streams

https, ftps, compress.zlib, compress.bzip2, php, file, glob, data, 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.

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

Ioncube loader is an extension that can decode PHP encoded file. Unfortunately, old versions (prior to version 4.0.9) are not working well with phar archives. 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:

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

Thanks to @Maerlyn for liking to that article.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top