Reputation: 83
I'm trying to deploy a Rest API on OVH. I devlopped it with symfony2.
everything was working on my local server but on OVH server, i have dificulties to use "composer update".
Fisrt i modified ".bashrc" to add "alias php5='php.ORIG.5_4 -c /usr/local/lib/php.ini-2'"
but when i use "php5 composer.phar update" it returns:
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
i don't know why buildBootstrap runs PHP 4
Thanks for your help
Upvotes: 1
Views: 543
Reputation: 74
If you want to have the same PHP version as in .ovhconfig in your SSH connection, you can use the .bashrc available on the OVH github: https://github.com/ovh/webhosting-ssh-bashrc
To apply it directly, you can use this code from your SSH connection
wget https://raw.githubusercontent.com/ovh/webhosting-ssh-bashrc/master/.bashrc -O $HOME/.bashrc
source $HOME/.bashrc
Upvotes: 2