Imx6 php support

I installed apache2 and php via opkg. I can serve html based pages. However, php interpreter don’t work. I find some solutions but they are for image creating. But I want to handle that on my runnig os. How can I do it? ( I tried google it, however, all i find it was debian based solutions)


Could you provide the version of the hardware and software of your module? Which carrier board are you using?

However, php interpreter don’t work.
What exactly is not working? Do you have some more Information?

I am working on Apalis IMX6 Quad core with ixora carrier board. And used standard embedded linux bsp.

The problem is php parts does not work. Only html parts can be seen on the page (I tested the code on ubuntu machine, I can see the results for php code)

For example: following code will only show only “My first PHP page”. Before asking I saved it as .php

<!DOCTYPE html>

<h1>My first PHP page</h1>

echo "Hello World!";


And you did build a custom image which adds your desired PHP feature set?

No I didn’t build custom image. Because at that point the project is not ready, every day something is adding to OS. I installed php and apache2 by using opkg.

The problem is apache2 do not use php before serving the web page. I found solutions like:

  1. using little program “a2enmod” — Debian package opkg can’t found it.

  2. install libapache2-mod-php5 package — Also can’t found.

At this point I need a to add php support to apache without re building the image. I can’t believe that I have to build custom image to add one program’s path to another program.

Whether you believe it or not it is the only solution.

If this the case, I will follow it. However, I am curious and I want to learn something from this problem, what is the reason behind this? Am I underestimating the problem or the problem is different from apache2’s calling for php interpreter?

No, Apache and PHP is just not part of any of our regular BSPs like millions of other possible packages for that matter.

hi @olivier.masson

Welcome to the Toradex Community. Could you ask a new question, please?

a2enmod means “apache2 enable module” with that you can enable php module on apache server then restart apache2 server and it will work.

However, on our stuff there is no a2enmod and you probably have to enable it in /etc/apache2/httpd.conf search in that file for the LoadModule command. PHP has to be loaded there.
I also never tried it out but you basically have to find the php*.so file that has been installed by opkg and then link it with apache in the respective config file.

Sorry, I am getting in the same case previously described. Do you have an estimation of the time/complexity of building a custom image to fix this case?