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.
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
Most helpful comment
@fornwall I have added these lines to httpd.conf:
and also index.php to DirectoryIndex directive, like this:
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! :)