Termux-packages: php mysqli extension not working with apache2

Created on 21 Nov 2017  路  7Comments  路  Source: termux/termux-packages

I tried running a web server using php + apache2 + php7 for apache module but unfortunately mysqli extension not include in this php,
so i installed php-mysql package and i already write
extension=mysqli.so to php.ini

When i tried running this script with php command

<?php
$mysqli = mysqli_init();

In terminal it's give me no error
But when i tried running in browser it's give me fatal error

Fatal error: Uncaught Error: Call to undefined function mysqli_init() in /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/test.php:8 Stack trace: #0 {main} thrown in /data/data/com.termux/files/usr/share/apache2/default-site/htdocs/test.php on line 8
bug report

Most helpful comment

Please update to php-7.1.12-1 package. php-mysql is built into the php package now, so, you don't need to have an entry for it in your php.ini

All 7 comments

did you specify that php.ini file using -c flag to php?

I am using default path of php.ini
$PREFIX/lib/php.ini

I don't think we have a default location for php.ini files.
You'll need to use other methods to manually specify your php.ini -> http://php.net/manual/en/configuration.file.php

Sorry, for false info.
I can confirm that php-mysql doesn't work with apache2.
nginx seems to be working.

Do you get any errors in log files?

i'm sorry but i already remove apache2 packages from termux last night.
Ok, i'll try using nginx.

Please update to php-7.1.12-1 package. php-mysql is built into the php package now, so, you don't need to have an entry for it in your php.ini

Tetew

Was this page helpful?
0 / 5 - 0 ratings

Related issues

stuart-little picture stuart-little  路  73Comments

ghost picture ghost  路  70Comments

ackalker picture ackalker  路  166Comments

urrut picture urrut  路  51Comments

Grimler91 picture Grimler91  路  96Comments