You are not logged in.

#1 2016-09-25 16:36:51

Dizi0
Member
Registered: 2016-09-25
Posts: 3

Nginx, PHP: Sqlite doesn't work!

Good evening, guys!
It's been a while since the last time I programmed something (and I've almost forgot everything!) but I felt inspired, recently, so I installed xginx with php and sqlite3.
Php is working fine, it has the classic phpinfo() page, but if I try to insert any sqlite functions (such this one, for example: http://php.net/manual/en/function.sqlite-open.php ) everything simply stop working!
All lines before the sqlite one are correctly read and they even work, but what comes next... nothing at all!

I've already installed php-sqlite, in the php.ini file I've removed the comments on the "extension=pdo_sqlite.so" and on the "extension=sqlite3.so" lines. I've even tried from the command line and it works.

So... what did I miss?
Thanks to you all!

P.S: I apologize for my english...

Last edited by Dizi0 (2016-09-25 16:37:43)

Offline

#2 2016-09-26 09:40:04

beta990
Member
Registered: 2011-07-10
Posts: 207

Re: Nginx, PHP: Sqlite doesn't work!

Make sure you have set display_error/error_reporting settings, otherwise you're not seeing any debug info.
The phpinfo() page should give you an overview if sqlite is enabled.
Don't forget to restart php-fpm/nginx.

Offline

#3 2016-10-02 18:45:18

Dizi0
Member
Registered: 2016-09-25
Posts: 3

Re: Nginx, PHP: Sqlite doesn't work!

Many thanks for your answer!

beta990 wrote:

Make sure you have set display_error/error_reporting settings, otherwise you're not seeing any debug info.

Done!

Fatal error: Uncaught Error: Call to undefined function sqlite_open() in /srv/http/index.php:9 Stack trace: #0 {main} thrown in /srv/http/index.php on line 9

It doesn't sound so good, does it? tongue

beta990 wrote:

The phpinfo() page should give you an overview if sqlite is enabled.
Don't forget to restart php-fpm/nginx.

On the phpinfo page sqlite simply doesn't appear...

Offline

#4 2016-10-02 19:09:30

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Nginx, PHP: Sqlite doesn't work!

Sounds like you don't have the SQLite module enabled in your php.ini file then.


Matt

"It is very difficult to educate the educated."

Offline

#5 2016-10-02 19:47:12

Dizi0
Member
Registered: 2016-09-25
Posts: 3

Re: Nginx, PHP: Sqlite doesn't work!

in the php.ini file I've removed the comments on the "extension=pdo_sqlite.so" and on the "extension=sqlite3.so" lines.

;extension=bcmath.so
;extension=bz2.so
;extension=calendar.so
extension=curl.so
;extension=dba.so
;extension=enchant.so
;extension=exif.so
;extension=ftp.so
;extension=gd.so
extension=gettext.so
;extension=gmp.so
;extension=iconv.so
;extension=imap.so
;extension=intl.so
;extension=ldap.so
;extension=mcrypt.so
;extension=mysqli.so
;extension=odbc.so
;zend_extension=opcache.so
extension=pdo_dblib.so
;extension=pdo_mysql.so
;extension=pdo_odbc.so
;extension=pdo_pgsql.so
extension=pdo_sqlite.so
;extension=pgsql.so
;extension=pspell.so
;extension=shmop.so
;extension=snmp.so
;extension=soap.so
;extension=sockets.so
extension=sqlite3.so
;extension=sysvmsg.so
;extension=sysvsem.so
;extension=sysvshm.so
;extension=tidy.so
extension=xmlrpc.so
extension=xsl.so
extension=zip.so

what did I miss?

Offline

#6 2016-10-03 16:36:14

mrunion
Member
From: Jonesborough, TN
Registered: 2007-01-26
Posts: 1,938
Website

Re: Nginx, PHP: Sqlite doesn't work!

Do you have SQLite installed? Version 2 or 3? I believe your call is for the version 2 way of opening a connection.

But in all honesty, you should not be calling native methods on the database, but should use PDO to open your data connection. Let Me Google That For You

Make sure you make an effort to help yourself and you will go far in the Arch community.

Last edited by mrunion (2016-10-03 16:38:31)


Matt

"It is very difficult to educate the educated."

Offline

Board footer

Powered by FluxBB