我试图在我的NAS上使用作曲家(一个很好的旧D-Link DNS-323运行非常好的fonz有趣插头0.7)。
我在/ffp/bin/php
安装了我的php。
使用以下命令安装composer时
php -r "readfile('https://getcomposer.org/installer');" | php -- --install-dir=/ffp/sbin --filename=composer
但是当我做一个简单的less /ffp/sbin/composer
时,我有以下shebang集:
#!/usr/bin/env php
<?php
/*
* This file is part of Composer.
*
不幸的是,我的NAS上没有/usr/bin/env
文件夹存在于我的机器上......
那么,我怎样才能让作曲家引用正确的php可执行文件?
此外,我尝试将声明更改为使用#!/ffp/bin/php
,但是这样做时,任何作曲家运行都会回应以下结果:
PHP Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/gd.so' - File not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/gd.so' - File not found in Unknown on line 0
PHP Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/sqlite.so' - File not found in Unknown on line 0
Warning: PHP Startup: Unable to load dynamic library '/ffp/lib/php/extensions/no-debug-non-zts-20100525/sqlite.so' - File not found in Unknown on line 0
PHP Fatal error: Uncaught exception 'PharException' with message 'phar "/mnt/HD_a2/ffp/sbin/composer" has a broken signature' in /mnt/HD_a2/ffp/sbin/composer:23
Stack trace:
#0 /mnt/HD_a2/ffp/sbin/composer(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in /mnt/HD_a2/ffp/sbin/composer on line 23
Fatal error: Uncaught exception 'PharException' with message 'phar "/mnt/HD_a2/ffp/sbin/composer" has a broken signature' in /mnt/HD_a2/ffp/sbin/composer:23
Stack trace:
#0 /mnt/HD_a2/ffp/sbin/composer(23): Phar::mapPhar('composer.phar')
#1 {main}
thrown in /mnt/HD_a2/ffp/sbin/composer on line 23
特别重要的是行
PHP Fatal error: Uncaught exception 'PharException' with message 'phar "/mnt/HD_a2/ffp/sbin/composer" has a broken signature' in /mnt/HD_a2/ffp/sbin/composer:23
我该如何解决?换句话说,如何在我的NAS上安装有效的php + composer?
答案 0 :(得分:0)
那么,我怎样才能让作曲家引用正确的php可执行文件?
一个非常简单的解决方案是创建一个shell脚本:
#!/bin/sh
/ffp/bin/php -n /ffp/sbin/composer "$@"
将其设为可执行文件,将其命名为composer
,将其放在/ffp/sbin
之前的路径中(或将/ffp/sbin/composer
重命名为composer.phar
并更新上述脚本。)
-n
标志告诉PHP不使用php.ini
。当从php.ini
加载许多扩展时,这非常有用;不加载它们会使composer
运行得更快。为提高速度,xdebug
composer
{{#if params.link}}
{{#link-to params.link}}
{{fa-icon icon=params.icon}}
{{#if params.label.left}}<span class="label label-left">{{params.label.left}}</span><i class="triangle triangle-right"></i>{{/if}}
{{#if params.text}}<span class="text">{{params.text}}</span>{{/if}}
{{#if params.label.right}}<i class="triangle triangle-left"></i><span class="label label-right">{{params.label.right}}</span>{{/if}}{{/if}}
{{/link-to}}
{{else}}
<button {{action params.action}}>
{{fa-icon icon=params.icon}}
{{#if params.label.left}}<span class="label label-left">{{params.label.left}}</span><i class="triangle triangle-right"></i>{{/if}}
{{#if params.text}}<span class="text">{{params.text}}</span>{{/if}}
{{#if params.label.right}}<i class="triangle triangle-left"></i><span class="label label-right">{{params.label.right}}</span>{{/if}}{{/if}}
</button>
{{/if}}
为2.2.0
。