1

I am currently creating a recipe with which I want to provide a web project. The web project is maintained in a Git repository and requires further dependencies on the target system which are maintained with Composer.

Now my approach was to install these in the do_compile() task. However, PHP and Composer do not seem to be available there, although I have included them as build time dependencies (DEPENDS).

What am I doing wrong?

SUMMARY = "Web project based on Laravel"

# [...]

DEPENDS = "php composer-php84"

# [...]

do_compile() {
    # Test for PHP
    php --version   # The first error message already appears here
    # Install Composer dependencies
    composer-php install
    # ... some more PHP calls
}

do_install() {
    # Copy files to webserver root.
}

The error message clearly shows that my dependencies (here PHP as an example) are not available:

run.do_compile.38482: line 143: php: command not found

2
  • I have no clue about composer, but installing things inside do_compile sounds very wrong already. do_compile is executed on the host, but DEPENDS is for cross compiled dependencies. Do you need the composer-installed dependencies on the target at runtime or on the host during build? Commented Feb 13 at 15:41
  • A shot in the blue: DEPENDS = "php-native composer-php84-native" should install the host binaries Commented Feb 13 at 15:43

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.