今天加密脚本的时候出现了这样的错误:

1
2
3
4
5
6
7
  > get bytes [  1 KB] move.ModelsBase
> get bytes [ 1 KB] move.Move
> get bytes [ 1 KB] move.OperationsBase
> get bytes [ 1 KB] move.ViewsBase
create ZIP archive file: ../res/game.zip
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 32 bytes) in /Users/zxsk/Documents/Project2/trunk/Developer/3rdlib/quick-cocos2d-x-2.2.5/bin/lib/quick/xxtea.php on line 351
bogon:proj.tools zxsk$ sh make_package.sh

stackoverflow.com 上发现这个答案:

The correct way is to edit your php.ini file. Edit memory_limit to your desire value.

As from your question, 128M (which is the default limit) has been exceeded, so there is something seriously wrong with your code as it should not take that much.

If you know why it takes that much and you want to allow it set memory_limit = 512M or higher and you should be good.

解决方案:

$QUICK-COCOS2D-X/bin/lib/quick/xxtea.php 的文件起始位置<?php上方加入:

1
<?php ini_set('memory_limit', '-1'); ?>

解决!