|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #81534 Math Functions are not working on SQLITE connection.
Submitted: 2021-10-18 06:10 UTC Modified: 2021-10-18 08:13 UTC
Avg. Score:4.0 ± 1.0
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:1 (50.0%)
From: iyashpal dot dev at gmail dot com Assigned:
Status: Open Package: SQLite related
PHP Version: 8.0.11 OS: Windows 11, 10
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: iyashpal dot dev at gmail dot com
New email:
PHP Version: OS:


 [2021-10-18 06:10 UTC] iyashpal dot dev at gmail dot com
PHP Version: 8.0.11
OS Edition: Windows 11 Pro
OS Version: 21H2
OS Build: 22000.258

PHP Framework Used: Laravel 8.63

Test script:
Route::get('/', function () {

    $sqlite = new SQLite3(base_path('sqlite3.dbi'), SQLITE3_OPEN_READWRITE);

    dd($sqlite->query('SELECT SQRT(4)'));
    dd(DB::select("SELECT SQRT(4)"));
    return view('welcome');

Expected result:
Should show 2

Actual result:
SQLite3::query(): Unable to prepare statement: 1, no such function: SQRT


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-18 06:16 UTC] iyashpal dot dev at gmail dot com
-Operating System: Windows 11 +Operating System: Windows 11, 10
 [2021-10-18 06:16 UTC] iyashpal dot dev at gmail dot com
PHP files were downloaded from this link :

I have tested this on Windows 10 Pro and 11 Pro.
 [2021-10-18 06:17 UTC]
-Package: PDO SQLite +Package: SQLite related
 [2021-10-18 08:13 UTC]
-Type: Bug +Type: Feature/Change Request
 [2021-10-18 08:13 UTC]
These functions need to be explicitly enabled when building
SQLite3[1], what has not been done so far.  Are these usually
available on other systems?

[1] <>
 [2021-10-21 01:36 UTC] iyashpal dot dev at gmail dot com
On a mac, it's working fine without extra effort. On Linux, working smoothly without any extra effort.
 [2021-10-21 01:46 UTC] iyashpal dot dev at gmail dot com
The thing is I am not aware of how I can enable the sqlite3 math functions. I have tried to replace the sqlite3 extension but PHP isn't working with it. I don't know I have done this wrong way or not but it wasted my 2 days. When I am unable to fix this, I came here to find a solution but no luck. Then I posted this issue here. I don't think this is a bug but maybe there should be some guidelines on the official documentation how we can deal with such problems. I am not able to find a perfect solution on the web. You are the only hope here. I can't proceed with my Test Driven Development with php sqlite3. Please help me. And I am sorry for the late reply because I thought this issue won't get anyone's attention because this is not a bug.

Please help me with a solution. I will be very greatful for this help.

Thank You
Yash Pal
 [2021-10-21 09:58 UTC] iyashpal dot dev at gmail dot com
If I try to compile the sql php showing this error.

PHP Warning:  PHP Startup: Can't load module 'C:\Users\<user-name>\.php\8.0\ext\php_sqlite3.dll' as it's linked with 2.37, but the core is linked with 14.29 in Unknown on line 0
 [2021-10-21 10:48 UTC] iyashpal dot dev at gmail dot com
Can anyone help me here?
 [2022-11-24 04:55 UTC] ayhenswcnickolas at gmail dot com
please any one can help I am struggling from last 3 weeks so please help me.
All suggestions appreciated.  (
 [2022-12-19 06:06 UTC] kimia dot salamxxo9881 at gmail dot com
Thaks for that. (
 [2023-05-02 12:28 UTC] timsmith12 at aol dot com
Has this been resolved yet?

 [2023-05-10 19:07 UTC] kevinwilsonq1 at aol dot com
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 08:01:32 2024 UTC