Click to See Complete Forum and Search --> : [RESOLVED] php5 Sqlite FC4 RPM


ednark
08-24-2005, 01:06 AM
so it turns out the php5 rpm on Fedora Core 4 does not come with Sqlite configured.
I could just recompile php5 but so far everything i've done has been rpm based and there is no php-sqlite rpm available for FC4. how do i mix in Sqlite without having to dump my pretty rpmed php/apache and just start recompiling everything from scratch? can i just compile sqlite myself as a php module and plop it in the extensions directory, if so where do i find info on doing that?

thorpe
08-24-2005, 01:36 AM
are you sure its not available? as far as i know its not an extension, it is part of php5.

planetsim
08-24-2005, 06:34 AM
In the PHP Compile command with FC4 it uses the --without-sqlite flag. Apparently there is some bug with it not entirely sure about it or what is happening but they are working on it. I found this thread on FedoraForums http://fedoraforum.org/forum/showthread.php?t=59802&highlight=php+sqlite hopefully should help you out.

ednark
08-24-2005, 02:11 PM
Yes the link was helpful and now i have sqlite working... here is a summary of that helpful post

------
I eventually figured out how to get this working

Fedora ships php5 compiled with "--without sqlite". I believe the php-pecl-sqlite module is not compiled for php5, there is a bug report filed and it looks like the fedora folks are only supporting php-pecl-pdo-sqlite. However i have a significant amount of code that uses PEAR DB.

Start with installing php-pecl-sqlite

$ pear download sqlite
OR
$ wget -q http://pecl.php.net/get/SQLite-1.0.3.tgz

then unpacked and began to compile it

$ tar zxvf SQLite-1.0.3.tgz
$ cd SQLite-1.0.3
$ phpize
$ ./configure
$ make

make failed here with some offset error

edit sqlite.c, comment out the following line:
/* static unsigned char arg3_force_ref[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; */

And then change these lines

function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, arg3_force_ref)
PHP_FE(sqlite_popen, arg3_force_ref)
to:
function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, third_arg_force_ref)
PHP_FE(sqlite_popen, third_arg_force_ref)


$ make
$ make install

make install plopped the .so into the correct directory without need of this

$ cp modules/sqlite.so /usr/lib/php/modules
$ /sbin/service/httpd restart

[quote]

cdaniel
03-14-2006, 10:06 AM
Hello!!!!
i was trying your recommended but i have this problem:

When i make a select of tha database from php page, everything is ok..
but when iīm going to make a insert or a update from php page, show an error, that can't open database, but in the select, yes it can!!!!!!!!
And when i trying to do this instructions from the shell, everything right!!
I donīt understand.
I have this situation in two CPU: FC3 + SQLite 2 + Apache 2 + PHP4
and FC4 + Php 5+ Sqlite2 + Apache 2.
And I need that works with the PHP.

I hope you can help me with this trouble.
My name is Daniel and i'm from Colombia, excuse if my english its no good.




Yes the link was helpful and now i have sqlite working... here is a summary of that helpful post

------
I eventually figured out how to get this working

Fedora ships php5 compiled with "--without sqlite". I believe the php-pecl-sqlite module is not compiled for php5, there is a bug report filed and it looks like the fedora folks are only supporting php-pecl-pdo-sqlite. However i have a significant amount of code that uses PEAR DB.

Start with installing php-pecl-sqlite

$ pear download sqlite
OR
$ wget -q http://pecl.php.net/get/SQLite-1.0.3.tgz

then unpacked and began to compile it

$ tar zxvf SQLite-1.0.3.tgz
$ cd SQLite-1.0.3
$ phpize
$ ./configure
$ make

make failed here with some offset error

edit sqlite.c, comment out the following line:
/* static unsigned char arg3_force_ref[] = {3, BYREF_NONE, BYREF_NONE, BYREF_FORCE }; */

And then change these lines

function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, arg3_force_ref)
PHP_FE(sqlite_popen, arg3_force_ref)
to:
function_entry sqlite_functions[] = {
PHP_FE(sqlite_open, third_arg_force_ref)
PHP_FE(sqlite_popen, third_arg_force_ref)


$ make
$ make install

make install plopped the .so into the correct directory without need of this

$ cp modules/sqlite.so /usr/lib/php/modules
$ /sbin/service/httpd restart

[quote]