Php and Node

chris.reeder's Avatar

chris.reeder

06 Feb, 2019 11:53 PM

We're building a wordpress plugin that is using a react application. I need a way to be able to install php and node in the same environment and run php tests along with normal yarn tests.

version: "1.0.0.{build}"


environment: nodejs_version: "8" live_key: secure: some key


install: - ps: Install-Product node $env:nodejs_version - ps: Install-Module -Name AzureTableEntity - npm install -g yarn - yarn install - yarn installYourstore - ps: Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - ps: choco install 7zip.install - ps: choco install composer - ps: choco install php ....

Once I install composer or php it all fails. Any ideas on what I can do? Or what I'm doing wrong?

Thanks

  1. Support Staff 1 Posted by Owen McDonnell on 07 Feb, 2019 02:03 AM

    Owen McDonnell's Avatar

    Before attempting to install composer try adding these two lines

    - ps: Set-Service wuauserv -StartupType Manual
    - cinst -y php
    
    which of course should obviate the need to run choco install php

    Let us know how it goes.

  2. 2 Posted by chris.reeder on 07 Feb, 2019 05:43 PM

    chris.reeder's Avatar

    Thanks for the reply.

    That helped. But I can't seem to get php unit installed using composer. I did this:

    - ps: Set-Service wuauserv -StartupType Manual
      - cinst -y php
      - cinst composer
      - cinst 7zip.install
    

    But I can't seem to find a way to use composer to install phpunit. I've tried a ton of different ways to do it. But each time it doesn't recognize composer as a command.

    Thanks for your help

    Chris

  3. 3 Posted by chris.reeder on 07 Feb, 2019 06:28 PM

    chris.reeder's Avatar

    It looks like it just doesn't recognize anything that is installed by the scripts. I executed composer straight from the file which then says php is not recognized... Is there a way to update the command variables in appeveyor?

  4. 4 Posted by chris.reeder on 07 Feb, 2019 06:43 PM

    chris.reeder's Avatar

    Nevermind

  5. Support Staff 5 Posted by Owen McDonnell on 07 Feb, 2019 08:28 PM

    Owen McDonnell's Avatar

    Do you mean that composer or php don't seem to be on the path after you install them?
    Have you tried this method?

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac