Adding php-curl in a Yocto build


I've been building a custom image using Yocto and wpewebkit to use within docker. I need to run a local web server with php, which I have accomplished no problem. I need to use curl within my project and I have apache2, php, modphp, and curl installed. All I need is php-curl but I cannot find how to install this. Does anyone know how or if I can do this? I've put in all my efforts on googling multiple phrases but I only find how to install php-curl using apt-get or yum, or I get links to the meta-* directories which I have access to within my build files anyways.

If it helps at all, this custom image was based on the image provided from the following project on GitHub: . I already spoke to the developer and their knowledge of PHP is limited.

EDIT #1: Progress so far, had to update the file to properly include libcurl-dev, and then worked with @pmod's suggestion to incorporate curl into the php build. Everything seemed to run okay until I received the following error:

| ../php-7.1.9/configure: line 386: test: please: integer expression expected
| configure: error: reinstall
| ../php-7.1.9/configure: line 275: return: please: numeric argument required
| ../php-7.1.9/configure: line 285: exit: please: numeric argument required
| NOTE: The following config.log files may provide further information.
| NOTE: /base-image/build/tmp-glibc/work/x86_64-linux/php-native/7.1.9-r0/build/config.log
| ERROR: configure failed
| WARNING: /base-image/build/tmp-glibc/work/x86_64-linux/php-native/7.1.9-r0/temp/run.do_configure.29590:1 exit 1 from 'exit 1'
| ERROR: Function failed: do_configure (log file is located at /base-image/build/tmp-glibc/work/x86_64-linux/php-native/7.1.9-r0/temp/log.do_configure.29590)
ERROR: Task (virtual:native:/base-image/build/../meta-openembedded/meta-oe/recipes-devtools/php/ failed with exit code '1'

Edit #2: I've gone ahead and added everything I was missing. I'm getting the same error above, where the function do_configure during the php build is failing. I'm posting below what I ensured I have in my file (I had to add this), what I have in my file, and the curl files located staging directory.

PACKAGES =+ "lib${BPN} lib${BPN}-native lib${BPN}-dev lib${BPN}-dev-native"

FILES_lib${BPN} = "${libdir}/lib*.so.*"

FILES_lib${BPN}-dev = "${includedir} \
                       ${libdir}/lib*.so \
                       ${libdir}/lib*.a \
                       ${libdir}/lib*.la \
                       ${libdir}/pkgconfig \
                       ${datadir}/aclocal \

EXTRA_OECONF_append = " --with-curl=${libdir}/.."
DEPENDS_${PN} += "libcurl-dev libcurl-dev-native"

PHP Staging Directory:




According to php manual, PHP/cURL feature is enabled at php configuration stage with --with-curl=[dir] option.

I checked the main recipe include file and couldn't find such configuration option. So, try creating in your working layer php_%.bbappend file with (or add this directly to the bottom of to test):

EXTRA_OECONF_append_class-target = " --with-curl=${STAGING_LIBDIR}/.."
DEPENDS_append_class-target = " curl"

Note, that curl package among DEPENDS because it is needed at build stage.

I don't think you need to update curl recipe with PACKAGES and FILES, pkg_config should take care

People are also looking for solutions to the problem: Does PHP allow class functions & properties to share the same name?


Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.