Termux-packages: Please include PHP module to work with apache2 in php package

Created on 8 Jun 2017  路  5Comments  路  Source: termux/termux-packages

I have tested the apache2 package in Termux and it seems to work very nicely, but at present there is no way to handle PHP because libphp.so module is missing. Presumably it should come with the php package as that is where the source is.

enhancement php

Most helpful comment

@fornwall I have added these lines to httpd.conf:

LoadModule php7_module /data/data/com.termux/files/usr/libexec/apache2/libphp7.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

and also index.php to DirectoryIndex directive, like this:

<IfModule dir_module>
    DirectoryIndex index.php
</IfModule>

And it worked! Thank you very much. I didn't realise that my web application works fine with PHP 7. So now I don't need PHP 5 anymore! :)

All 5 comments

keep in mind that php is php7 in termux so you'll need to load libphp7.so in apache2 config.
I've opened #1075

@tigran123 Thanks to @vishalbiswas there is now a php-apache package available - could you try it out and see if it works (I made a build change but haven't tested if myself)?

@fornwall I have added these lines to httpd.conf:

LoadModule php7_module /data/data/com.termux/files/usr/libexec/apache2/libphp7.so

<FilesMatch \.php$>
    SetHandler application/x-httpd-php
</FilesMatch>

and also index.php to DirectoryIndex directive, like this:

<IfModule dir_module>
    DirectoryIndex index.php
</IfModule>

And it worked! Thank you very much. I didn't realise that my web application works fine with PHP 7. So now I don't need PHP 5 anymore! :)

馃槏

After adding the lines in httpd.conf this is what I get:
Syntax error on line 69 of /data/data/com.termux/files/usr/etc/apache2/httpd.conf: LoadModule takes two arguments, a module name and the name of a shared object file to load it from

Was this page helpful?
0 / 5 - 0 ratings

Related issues

neitsab picture neitsab  路  3Comments

Wetitpig picture Wetitpig  路  3Comments

ILadis picture ILadis  路  3Comments

bkdwt picture bkdwt  路  3Comments

divyakutty picture divyakutty  路  3Comments