Got yocto to build with php and apache2 as show here
installing-PHP
In my conf/local.conf i have set this
IMAGE_INSTALL:append = " php-dbg php-cli php-cgi php-fpm php-fpm-apache2 php-dev php-doc php"
PACKAGECONFIG:append:pn-php = " apache2 mysql sqlite3"
Flashed the image and in console php -v works. But the apache2 server cannot serve any .php files. It returns 'File not found. '
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.
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.