How to use bitbucket pipelines on a php application?

I have the following pipeline script which does execute but I get a java error. (Project Home must be an existing directory: /root/src)

Is there a better docker-image to use, or some instructions on building the sonar-scanner within the image the default image?

default:
    - step:
        image: skilldlabs/sonar-scanner
        name: Sonarcloud
        script:
            - sonar-scanner
                -Dsonar.projectKey=myproject
                -Dsonar.organization=myorg
                -Dsonar.sources=.
                -Dsonar.host.url=https://sonarcloud.io
                -Dsonar.login=mykey

Any help would be appreciated.

Running analysis on a PHP project in Bitbucket Pipeline should be really easy. Please follow the instructions of the documentation (https://sonarcloud.io/documentation/integrations/bitbucketcloud/) and look at the sample project (the nodejs one) where you will see the following configuration for your pipe:

    - step: &build-test-sonarcloud
        name: Build, test and analyze on SonarCloud
        caches:
          - sonar
        script:
          - pipe: sonarsource/sonarcloud-scan:0.1.5
            variables:
              SONAR_TOKEN: ${SONAR_TOKEN}