Need help installing PHP

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

Need help installing PHP

Jump to solution
1,358 Views
intosite
Contributor II

Trying to run a webserver on the imx8mpevk.

Managed to install Nginx and run. But having issues with PHP.

in local.conf, added IMAGE_INSTALL:append = " php"

bitbake imx-image-full with no errors.

Loaded the image onto emmc, but trying to run php -v gives command not found.

 

In /opt/yocto/imx-6.6.52-2.2.0-build/build_fsl-imx-xwayland/tmp/work/armv8a-poky-linux/php/8.2.20/temp install logs show no errors.

 

Not sure how to proceed

0 Kudos
Reply
1 Solution
1,265 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please delete php-staticdev from the list.

Please add the following line in file conf/local.conf.

IMAGE_INSTALL:append = " php-dbg php-cli php-cgi php-fpm php-fpm-apache2 php-dev php-doc php"

Then rebuild rootfs filesystem.

$ bitbake imx-image-full

If your problem persists, please provide your build error log.

View solution in original post

0 Kudos
Reply
8 Replies
1,257 Views
intosite
Contributor II

This works now and compiles. Flash the image and load it. php -v works. But apache2 still unable to serve .php files

0 Kudos
Reply
1,239 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please check whether this file exist in your system.

/usr/lib/php7/build/run-tests.php

I didn't find other *.php file provided by php package.

0 Kudos
Reply
1,225 Views
intosite
Contributor II

I uploaded my own php file to '/usr/share/apache2/default-site/htdocs'.

 

// /usr/share/apache2/default-site/htdocs/info.php
<?php
phpinfo();
?>

 

When I try to access it, browser returns 'File not found.' index.html and plain text .txt files work, so I can confirm apache is server files from the folder.

 

 

root@imx8mpevk:/var/files# ls /usr/lib/php7/build/run-tests.php
ls: cannot access '/usr/lib/php7/build/run-tests.php': No such file or directory

 

 

Found the file in '/usr/lib/php8/build' and ran it. Below is the output.

 

root@imx8mpevk:/usr/lib/php8/build# php run-tests.php

=====================================================================
PHP         : /usr/bin/php
PHP_SAPI    : cli
PHP_VERSION : 8.2.20
ZEND_VERSION: 4.2.20
PHP_OS      : Linux - Linux imx8mpevk 6.6.52-lts-next-ge0f9e2afd4cf #1 SMP PREEMPT Tue Nov 19 23:01:49 UTC 2024 aarch64
INI actual  : /etc/php/apache2-php8/php.ini
More .INIs  :
---------------------------------------------------------------------
PHP         : /usr/bin/php-cgi
PHP_SAPI    : cgi-fcgi
PHP_VERSION : 8.2.20
ZEND_VERSION: 4.2.20
PHP_OS      : Linux - Linux imx8mpevk 6.6.52-lts-next-ge0f9e2afd4cf #1 SMP PREEMPT Tue Nov 19 23:01:49 UTC 2024 aarch64
INI actual  : /etc/php/apache2-php8/php.ini
More .INIs  :
---------------------------------------------------------------------
CWD         : /usr/lib/php8/build
Extra dirs  :
VALGRIND    : Not used
=====================================================================
TIME START 2025-03-13 05:46:32
=====================================================================
No tests were run.

 

 

0 Kudos
Reply
1,220 Views
yipingwang
NXP TechSupport
NXP TechSupport

Would you please create a new thread to address the apache2 server running problem?

0 Kudos
Reply
1,260 Views
intosite
Contributor II

Yes this works now. Flashed the image and in console php -v works. But the apache2 server cannot serve any .php files. It returns 'File not found. '

In my conf/local.conf i have set this

PACKAGECONFIG:append:pn-php = " apache2 mysql sqlite3"

 

0 Kudos
Reply
1,287 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please add the following line in file conf/local.conf.

IMAGE_INSTALL:append = " php-dbg php-cli php-cgi php-fpm php-fpm-apache2 php-dev php-staticdev php-doc php"

Then rebuild rootfs filesystem.

bitbake imx-image-full

0 Kudos
Reply
1,283 Views
intosite
Contributor II

Does not work.

Get error and it stops there.

Reading package lists...
Building dependency tree...
Reading state information...
E: Unable to locate package php-staticdev

 

If i try to bitbake them individually, i get all the same errors.

bitbake php-dbg
ERROR: Nothing PROVIDES 'php-dbg'. Close matches:
  php RPROVIDES php-dbg

bitbake php-cli
ERROR: Nothing PROVIDES 'php-cli'. Close matches:
  php RPROVIDES php-cli

bitbake php-cgi
ERROR: Nothing PROVIDES 'php-cgi'. Close matches:
  php RPROVIDES php-cgi

bitbake php-fpm
ERROR: Nothing PROVIDES 'php-fpm'. Close matches:
  php RPROVIDES php-fpm

bitbake php-fpm-apache2
ERROR: Nothing PROVIDES 'php-fpm-apache2'. Close matches:
  php RPROVIDES php-fpm-apache2

bitbake php-dev
ERROR: Nothing PROVIDES 'php-dev'. Close matches:
  php RPROVIDES php-dev

bitbake php-doc
ERROR: Nothing PROVIDES 'php-doc'. Close matches:
  php RPROVIDES php-doc

 

Only bitbake php works and completes.

0 Kudos
Reply
1,266 Views
yipingwang
NXP TechSupport
NXP TechSupport

Please delete php-staticdev from the list.

Please add the following line in file conf/local.conf.

IMAGE_INSTALL:append = " php-dbg php-cli php-cgi php-fpm php-fpm-apache2 php-dev php-doc php"

Then rebuild rootfs filesystem.

$ bitbake imx-image-full

If your problem persists, please provide your build error log.

0 Kudos
Reply