Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Run path/to/php path/to/composer #90

Open
antoine1003 opened this issue Mar 21, 2019 · 3 comments
Open

Run path/to/php path/to/composer #90

antoine1003 opened this issue Mar 21, 2019 · 3 comments

Comments

@antoine1003
Copy link

Hi,

I read that I could set up php and composer path in the config file :
MY CONFIG FILE

public function configure()
    {
        return $this->getConfigBuilder()
            ->server('u9687801@access77813520.webspace-data.io')
            ->deployDir('/kunden/homepages/9/d77835205/htdocs/des-hauts-debats')
            ->repositoryUrl('git@gitlab.com:antoine1003/des-hauts-debats.git')
            ->remotePhpBinaryPath('/usr/bin/php7.1-cli')
            ->remoteComposerBinaryPath('/kunden/homepages/9/d77813505/htdocs/composer.phar')
            ->repositoryBranch('prod')
        ;
    }

But when I run php bin/console deploy it use just /kunden/homepages/9/d77813505/htdocs/composer.phar update for example and I want it to use the full syntax /usr/bin/php7.1-cli kunden/homepages/9/d77813505/htdocs/composer.phar update because the default server php version is outdated and I can't change it (mutualised server).

Is there any way to do it?

@bopoda
Copy link

bopoda commented Apr 17, 2019

I have the same issue.
remotePhpBinaryPath is ignored when run composer. Just composer is called without certain PHP interpreter.

In my opinion, the expected behavior is: php binary path is used for composer as well.

  [Symfony\Component\Process\Exception\ProcessFailedException]                                                                                                                                                                               
  The command "ssh -A srv115367@ssh-115367.srv.hoster.ru '(export APP_ENV=prod; cd /storage/home/srv115367/project/releases/20190417184522 && /storage/home/srv115367/project/composer.phar install --no-dev --prefer-dist   
  --no-interaction --quiet)'" failed.                                                                                                                                                                                                        
                                                                                                                                                                                                                                             
  Exit Code: 2(Misuse of shell builtins)                                                                                                                                                                                                     
                                                                                                                                                                                                                                             
  Working directory: /var/www/project                                                                                                                                                                                                   
                                                                                                                                                                                                                                             
  Output:                                                                                                                                                                                                                                    
  ================                                                                                                                                                                                                                           
                                                                                                                                                                                                                                             
                                                                                                                                                                                                                                             
  Error Output:                                                                                                                                                                                                                              
  ================                                                                                                                                                                                                                           
  Your requirements could not be resolved to an installable set of packages.

@kordax
Copy link

kordax commented Nov 5, 2019

You can avoid this by specifying something like:

->remoteComposerBinaryPath('/usr/local/bin/php7.3 /usr/local/bin/composer')

in your DefaultDeployer (deploy.php file):
public function configure()

    {
        return $this->getConfigBuilder()
            ...
            ->remoteComposerBinaryPath('/usr/local/bin/php7.3 /usr/local/bin/composer')
            ->repositoryBranch('prod');
    }

@bopoda
Copy link

bopoda commented Nov 5, 2019

@kordax , probably, yes:)
But we have the method remotePhpBinaryPath which should be responsible to set PHP binary path, otherwise, we do it twice (remotePhpBinaryPath and remoteComposerBinaryPath as in your example)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants