Я пытаюсь развернуть Rest API для OVH. Я развязал его с symfony2.
все работало на моем локальном сервере, но на сервере OVH, у меня есть возможности использовать "композиторское обновление".
Fisrt я изменил ".bashrc", чтобы добавить "alias php5 = 'php.ORIG.5_4 -c/usr/local/lib/php.ini-2'"
но когда я использую "php5 composer.phar update", он возвращает:
Loading composer repositories with package information
Updating dependencies (including require-dev)
- Removing jms/serializer-bundle (1.0.0)
- Installing jms/serializer-bundle (1.1.0)
Downloading: 100%
Writing lock file
Generating autoload files
> Incenteev\ParameterHandler\ScriptHandler::buildParameters
Updating the "app/config/parameters.yml" file
> Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap
X-Powered-By: PHP/4.4.9
Content-type: text/html
<br />
<b>Parse error</b>: syntax error, unexpected T_STRING, expecting T_CONSTANT_ENCAPSED_STRING or '(' in <b>/home/findexpocq/Rest/vendor/sensio/distribution-bundle/Sensio/Bundle/DistributionBundle/Resources/bin/build_bootstrap.php</b> on line <b>13</b><br />
Script
Sensio\Bundle\DistributionBundle\Composer\ScriptHandler::buildBootstrap handling the post-update-cmd event terminated with an exception
[RuntimeException]
An error occurred when generating the bootstrap file.
update [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--lock] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [--with-dependencies] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [--prefer-stable] [--prefer-lowest] [--] [<packages>]...
X-Powered-By: PHP/5.4.38
Content-type: text/html
Warning: Composer should be invoked via the CLI version of PHP, not the cgi-fcgi SAPI
я не знаю, почему buildBootstrap запускает PHP 4
Спасибо за вашу помощь
Если вы хотите иметь ту же версию PHP, что и в.ovhconfig, в вашем SSH-соединении, вы можете использовать.bashrc, доступный в OVH github: https://github.com/ovh/webhosting-ssh-bashrc
Чтобы применить его напрямую, вы можете использовать этот код из своего SSH-соединения
wget https://raw.githubusercontent.com/ovh/webhosting-ssh-bashrc/master/.bashrc -O $HOME/.bashrc
source $HOME/.bashrc