Phar in gzip compression

Continuing the discussion from Loading phar as a library and Error uploading 20MB phar file :

phpinfo shows:

Phar: PHP Archive support enabled
Phar API version 1.1.1
Phar-based phar archives enabled
Tar-based phar archives enabled
ZIP-based phar archives enabled
gzip compression enabled
bzip2 compression disabled (install ext/bz2)
OpenSSL support enabled

but when using a phar.gz file (sized 5.3MB), I get the following errors:

Warning: require_once(): open_basedir restriction in effect. File(/home/vol15_4/ is not within the allowed path(s): (/php_sessions:/tmp:/var/www/errors:/usr/share/pear:/home/vol15_4/ in /home/vol15_4/ on line 22

Notice: require_once(): write of 8192 bytes failed with errno=28 No space left on device in /home/vol15_4/ on line 22

Warning: require_once(phar:///home/vol15_4/ failed to open stream: unable to decompress gzipped phar archive "/home/vol15_4/" to temporary file in /home/vol15_4/ on line 22

does the phar.gz support ends here due to some policy? if so, why enable the phar.gz support for free tier?

Looking at the last two error messages, it seems that PHP first needs to extract your phar.gz file in order to access it. But the location to where it wants to extract the phar doesn’t have enough space to do that.

I just checked your website and it seems to be working now, but it’s possible the location for temporary files is quite small because very few people and sites use phar archives like this.

Just to be clear, we’re not blocking this due to policy. You’re just using a feature that’s very rarely used, which means you’re more likely to run into bugs and errors which we simply were not aware of.

If this ever happens again (or if you can reproduce this right now), we may be able to fix this.

But given that this is the third topic about phar archives, it seems to me that you can save yourself a lot of headache by just downloading the zip file of the google-api-client package, extracting that, and uploading the extracted directory. I can’t even find the phar in the official releases or documentation.


Thanks, I’ve been trying to reduce the inode usage (seeing as there are too many files this api uses…) so I created a phar file instead :frowning:

it’s already reproduced… same errors as last time. I guess I’ll have to (re)upload the folder as is.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.