PHP how to update

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

PHP how to update

29,604 Views
goodwell
Contributor I

Hello

I am working with an i.MX6 dev board.

I am using ltib to create the uboot/kernel/fs image.

My project uses the apache webserver with PHP.

I need to use json encoding functions through PHP which became enabled by default on PHP version 5.2.x.

The version that is created by ltib is 5.0.4, so it doesnt reconize the json functions.

The current spec file for PHP includes 4 patches that have something to do with the fsl, crosscompiling and zend.

I've tried copying the binaries for PHP 5.5.5 (the latest) into /opt/freescale/pkgs and reworking the spec and patch files, but the build fails, also fails if I dont include the patches.

When I try to build, i get to the PHP package, then fail at the point of checking to enable DOM support.

configure error: DOM extension requires LIBXML extension, add --enable-libxml

When i check through ltib, I find ---libxml2 is enabled by default and I cant even unselect it, so I'm not sure where I would perform this; add --enable-libxml

How to do I update this PHP package?! or do I look for a patch for json functions?

Thanks for any insight!

0 Kudos
Reply
17 Replies

3,021 Views
LeonardoSandova
Specialist I

Scott, if you are not tied to LTIB, you can try Yocto adding this recipe

OpenEmbedded metadata index - php

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

..Hmmm

I'm only tied to what works, I've never used Yocto before and I'm

relatively new to ltib, would you recommend this transition?

On Thu, Oct 31, 2013 at 11:28 AM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Yes, move it now :smileyhappy:  There are some documents out there to start (check Daiane Angolini'sTasks). Let us know any trouble in the process.

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

Hi Leo,

I have gotten to the point of successfully building and booting

fsl-image-test,

I want to be able to add apache and php, is there anything pre-built into

yocto that I can enable to have these packages included in the build? or do

I build my own recipes?

Thanks!

On Thu, Oct 31, 2013 at 11:45 AM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Hi Scott, there is not need to implement those recipes you need. In the link I posted before, there is a search's field, just type any package you want and see in which layer is located. Then clone that layer, add it on bblayers.conf, finally add the package name to your local.conf. Actually, this last step is no so elegant, in the sense that you are modifying a global configuration file, so all images (by image here, I mean the ones on tmp/deploy/images) you bake will contain the packages you add it there. One good approach is to create a layer and inside create a NEW image (by image here I mean the .bb file) where you know it has all you want. I have create a 'demo' layer here

https://github.com/lsandoval/meta-lsandoval/tree/master/meta-fsl-custom

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

Thanks Leo,

Getting closer, I see in bblayers.conf where I need to add the directory

for meta-webserver, but for updating the local.conf, i'm not sure what to

add.

There are a few packages in the meta-webserver directory, do I add them all

individually using

IMAGE_INSTALL_append = " "

and, where in local.conf should this be set, if it needs to be

On Wed, Nov 6, 2013 at 10:05 AM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Yes, so can do it that way (there is another variable which is more commonly used, CORE_IMAGE_EXTRA_INSTALL, both do the job). Once you have all packages you need, the next step is to create a new .bb image. There is an example also on the repo I sent before.

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

Thanks again Leo,

Just wanted to clear a couple things up,

in my sources directory, I have a directory called meta-openembedded, which

contains meta-webserver, which has a conf/layer.conf and .bb image in

meta-httpd/apache2 already. If I didn't want to create my own custom layer,

can i just add the meta-webserver directory to bblayers.conf.

Although, I have already tried this and it didn't work.

Appreciate your help.

On Wed, Nov 6, 2013 at 1:55 PM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Hi Scott.

I may have confused you. You have two options,

You can either

  1. Add meta-webserver into your bblayers.conf file, and then modify the local.conf to add your pkgs with IMAGE_... or CORE_.... This is a quick and dirty approach which does not scale well.
  2. Add meta-webserver AND your new layer on bblayers.conf. On your NEW layer, you can create an image like this. Then bake. For this case, you do not need to touch local.conf and any other file, except (of course) your layer and the bblayers (so  bitbake knows where to look for stuff).

Leo

0 Kudos
Reply

3,021 Views
lzh_kc
Contributor I

hi, Leo,

I'm in the same situation as Scott. I,d like to see your demo, but the link you provided is not valid now, can you provide it again, thanks.

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

I'll check that out,

I've been trying to massage fsl-image-test for most of my testing, things

are starting to get clearer.

I tried adding httpd and php packages by changing the

packagegroup-fsl.bbfile like this;

PROVIDES = "$"

PACKAGES += " \

$-gstreamer \ $-gstreamer-streamer \

$-tools-testapps \ $-tools-benchmark \

$-httpd \ $-php \

"

with this at the bottom;

RDEPENDS_$

  1. Disabled as it has CRC problems in denzil branch
  2. cpuburn-neon
-httpd = " \ apache2 \ " ALLOW_EMPTY_$ = "1"

ALLOW_EMPTY_$-gstreamer = "1" ALLOW_EMPTY_$-tools-testapps = "1"

ALLOW_EMPTY_$-tools-benchmark = "1" ALLOW_EMPTY_$-httpd = "1"

ALLOW_EMPTY_$-php = "1"

PACKAGE_ARCH = "$"

bitbake went through the build process without any errors, and my sd card

boots, but i can't find /htdocs, where would the root of the webserver be?

or am I still missing something..

Appreciate the time

On Wed, Nov 6, 2013 at 3:43 PM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Actually you are facing another problem. One thing is the recipe name and another thing what you want to install on you FS from that recipe. On the recipes (php and apache), look at the PACKAGE variable,for example http://cgit.openembedded.org/meta-openembedded/plain/meta-oe/recipes-devtools/php/php.inc so I believe what you really need to use is php-cli or php-dev. The same may also apply for apache. Also, find the working folders on tmp/work, then inside look at the packages-split folder. This is another way to figure out what each -XXX installs....

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

Leo

I found the recipe name to be -dev for both php and apache.

I got the apache webserver working: great

I cannot seem to add the php though. I seem to get an error when I do the

build. Can you make sense of this..

Here is my packagegroup.bb;

(the beginning)

PROVIDES = "$"

PACKAGES += " \

$-gstreamer \ $-gstreamer-streamer \

$-tools-testapps \ $-tools-benchmark \

$-httpd-dev \ $-php-dev \

"

(the end)

RDEPENDS_$-httpd-dev = " \ apache2 \ " RDEPENDS_$-php-dev += " \

phpmyadmin \

xdebug \

modphp \

"

  1. Disabled as it has CRC problems in denzil branch

  2. cpuburn-neon

ALLOW_EMPTY_$ = "1" ALLOW_EMPTY_$-gstreamer = "1"

ALLOW_EMPTY_$-tools-testapps = "1" ALLOW_EMPTY_$-tools-benchmark = "1"

ALLOW_EMPTY_$-httpd-dev = "1" ALLOW_EMPTY_$-php-dev = "1"

PACKAGE_ARCH = "$"

And part of the fsl-image-test.bb image;

IMAGE_INSTALL += " \

packagegroup-fsl-gstreamer \

packagegroup-fsl-tools-testapps \

packagegroup-fsl-tools-benchmark \

"

IMAGE_INSTALL_append = " packagegroup-fsl-httpd-dev"

IMAGE_INSTALL_append = " packagegroup-fsl-php-dev"

And here is the build erros;

make[4]: Entering directory

`/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/mariadb-5.1.67/libmysqld/examples'

| ../../i686-linux-libtool --tag=CXX --mode=link g++

-isystem/home/gw/build/tmp/sysroots/i686-linux/usr/include -O2 -pipe

-fno-implicit-templates -fno-exceptions -fno-rtti

-L/home/gw/build/tmp/sysroots/i686-linux/usr/lib

-L/home/gw/build/tmp/sysroots/i686-linux/lib

-Wl,-rpath-link,/home/gw/build/tmp/sysroots/i686-linux/usr/lib

-Wl,-rpath-link,/home/gw/build/tmp/sysroots/i686-linux/lib

-Wl,-rpath,/home/gw/build/tmp/sysroots/i686-linux/usr/lib

-Wl,-rpath,/home/gw/build/tmp/sysroots/i686-linux/lib -Wl,-O1 -rdynamic -o

mysqltest_embedded mysqltest.o ../../libmysqld/libmysqld.la -ldl

../../regex/libregex.la -lpthread -lcrypt -lnsl -lm -lpthread -lcrypt

-lnsl -lm -lz

| i686-linux-libtool: link: g++

-isystem/home/gw/build/tmp/sysroots/i686-linux/usr/include -O2 -pipe

-fno-implicit-templates -fno-exceptions -fno-rtti -Wl,-rpath-link

-Wl,/home/gw/build/tmp/sysroots/i686-linux/usr/lib -Wl,-rpath-link

-Wl,/home/gw/build/tmp/sysroots/i686-linux/lib -Wl,-rpath

-Wl,/home/gw/build/tmp/sysroots/i686-linux/usr/lib -Wl,-rpath

-Wl,/home/gw/build/tmp/sysroots/i686-linux/lib -Wl,-O1 -rdynamic -o

.libs/mysqltest_embedded mysqltest.o

-L/home/gw/build/tmp/sysroots/i686-linux/usr/lib

-L/home/gw/build/tmp/sysroots/i686-linux/lib

../../libmysqld/.libs/libmysqld.so -ldl ../../regex/.libs/libregex.a

-lpthread -lcrypt -lnsl -lm -lz -Wl,-rpath

-Wl,/home/gw/build/tmp/sysroots/i686-linux/usr/lib/mysql

| ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlopen'

| ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlclose'

| ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlerror'

| ../../libmysqld/.libs/libmysqld.so: undefined reference to `dlsym'

| collect2: error: ld returned 1 exit status

| make[4]: *** Error 1

| make[4]: Leaving directory

`/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/mariadb-5.1.67/libmysqld/examples'

| make[3]: *** Error 2

| make[3]: Leaving directory

`/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/mariadb-5.1.67/libmysqld/examples'

| make[2]: *** Error 1

| make[2]: Leaving directory

`/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/mariadb-5.1.67/libmysqld'

| make[1]: *** Error 2

| make[1]: Leaving directory

`/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/mariadb-5.1.67/libmysqld'

| make: *** Error 1

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at

/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/temp/log.do_compile.21680)

ERROR: Task 4578

(/home/gw/sources/meta-openembedded/meta-oe/recipes-support/mysql/

mariadb-native_5.1.67.bb, do_compile) failed with exit code '1'

NOTE: Tasks Summary: Attempted 3632 tasks of which 3629 didn't need to be

rerun and 1 failed.

Waiting for 0 running tasks to finish:

Summary: 1 task failed:

/home/gw/sources/meta-openembedded/meta-oe/recipes-support/mysql/

mariadb-native_5.1.67.bb, do_compile

Summary: There was 1 WARNING message shown.

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

If I eliminate the php code from the .bb files everything builds fine and

the web server works.

Thanks for any insight

On Wed, Nov 6, 2013 at 4:08 PM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Could you try this?

bitbake -c cleansstate mariadb-native

and try again. Sometimes this little trick (clean the sstate before compiling) works when facing a compilation issue.

Also on packagegroup-fsl-php-dev, try adding packages one by one, just to narrow down the pkg giving problems this time.

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

Hi Leo,

This issue is still giving me grief,

Should I be using the php out of the webserver directory or the devtools

directory?

Would there be a working example of how to do a lamp install or even just a

php install using yocto?

Thanks,

Scott Penner

Goodwell Inc.

c. 4033761977

a. Box 906 Brooks, Ab T1R1B8

On Nov 7, 2013, at 10:59 AM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply

3,021 Views
LeonardoSandova
Specialist I

Hi Scott,

Could you post your question on the proper layer? this a meta-openembedded related code, so the list would be

Openembedded-devel Info Page

Leo

0 Kudos
Reply

3,021 Views
goodwell
Contributor I

Thanks Leo, tried that bitbake command, when I build again, I still get

this error;

/5.1.67-r0/mariadb-5.1.67/libmysqld'

| make: *** Error 1

| ERROR: oe_runmake failed

| WARNING: exit code 1 from a shell command.

| ERROR: Function failed: do_compile (log file is located at

/home/gw/build/tmp/work/i686-linux/mariadb-native/5.1.67-r0/temp/log.do_compile.23953)

ERROR: Task 4552

(/home/gw/sources/meta-openembedded/meta-oe/recipes-support/mysql/

mariadb-native_5.1.67.bb, do_compile) failed with exit code '1'

NOTE: Tasks Summary: Attempted 5062 tasks of which 5055 didn't need to be

rerun and 1 failed.

No currently running tasks (5062 of 5092)

Summary: 1 task failed:

/home/gw/sources/meta-openembedded/meta-oe/recipes-support/mysql/

mariadb-native_5.1.67.bb, do_compile

Summary: There was 1 WARNING message shown.

Summary: There was 1 ERROR message shown, returning a non-zero exit code.

I only appended modphp in packagegroup for install;

PROVIDES = "$"

PACKAGES += " \

$-gstreamer \ $-gstreamer-streamer \

$-tools-testapps \ $-tools-benchmark \

$-httpd-dev \ $-php-dev \

"

RDEPENDS_$-httpd-dev = " \ apache2 \ " RDEPENDS_$-php-dev = " \

modphp \

"

and for the fsl-image-test;

IMAGE_INSTALL_append = " packagegroup-fsl-httpd-dev"

IMAGE_INSTALL_append = " packagegroup-fsl-php-dev"

Do I have to have mysql installed or add it to a layer to install php?

Thanks

On Thu, Nov 7, 2013 at 10:59 AM, Leonardo Sandoval Gonzalez <

0 Kudos
Reply