Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that it can
either be access directly, or through the PDO interface.
Can you confirm that the RPM that I used will only allow me to work
through PDO, and not the SQLite library directly, and which is more
recommended?
=====
PHP Version 5.1.6
System Linux asterisk.acme 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22
08:32:04 EDT 2007 i686
Build Date Sep 20 2007 10:01:50
Configure Command './configure' [...] '--without-sqlite' [...]
'--enable-fastcgi' '--enable-pdo=shared'
'--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr'
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr'
=====
Thank you. 9 6902
On Dec 8, 6:54 pm, Gilles Ganault <nos...@nospam.comwrote:
Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that it can
either be access directly, or through the PDO interface.
Can you confirm that the RPM that I used will only allow me to work
through PDO, and not the SQLite library directly, and which is more
recommended?
In Centos sqlite may not have been automatically installed or PHP was
not configured the SQL Lite libraries, do a quick check first to see
if sqlite is installed and then check the sqlite docs and make sure
php.ini has the proper settings to recognize it existing. (I've had to
do similar with setting up MySQL in Centos)
On Sat, 8 Dec 2007 20:19:00 -0800 (PST), la***@portcommodore.com
wrote:
>In Centos sqlite may not have been automatically installed or PHP was not configured the SQL Lite libraries, do a quick check first to see if sqlite is installed and then check the sqlite docs and make sure php.ini has the proper settings to recognize it existing. (I've had to do similar with setting up MySQL in Centos)
Thanks for the tip. Apparently, it's working. For those interested, I
did the following:
1. Remove Apache
2. Install the Lighttpd package
3. Install the Lighttpd FastCGI package
4. If not already installed, install PHP, including the FastCGI
version (run "php -v", and "php-cgi -v" to check)
5. Install the PDO package, which includes the SQLite module
6. Add this to a PHP page in Lighttp's www directory to check that the
whole thing works:
foreach(PDO::getAvailableDrivers() as $driver)
{
echo $driver.'<br />';
}
=Apparently, there are two ways to access SQLite from PHP: Either
directly, or through PDO. Is that correct? Which is better? Are there
other ways I should know about?
Thank you.
Gilles Ganault wrote:
=Apparently, there are two ways to access SQLite from PHP: Either
directly, or through PDO. Is that correct?
Yes. (assuming that by "directly" you mean "through the SQLite libraries")
Which is better?
Depends on your meaning of "better".
--
----------------------------------
Iván Sánchez Ortega -ivansanchez-algarroba-escomposlinux-punto-org-
MSN:i_*************************@hotmail.com
Jabber:iv*********@jabber.org ; iv*********@kdetalk.net
On Sun, 09 Dec 2007 20:55:52 +0100, Iván Sánchez Ortega
<ivansanchez-alg@rroba-escomposlinux.-.punto.-.orgwrote:
>Yes. (assuming that by "directly" you mean "through the SQLite libraries")
Yup, that's what I meant. Here's what CentOS has installed:
# rpm -qa | grep sqlite
sqlite-3.3.6-2
python-sqlite-1.1.7-1.2.1
# rpm -qa | grep php
php-cli-5.1.6-15.el5
php-common-5.1.6-15.el5
php-pdo-5.1.6-15.el5
>Depends on your meaning of "better".
Which is recommended for production work, has the more traction, is
the more stable, etc. :-)
On Dec 8, 9:54 pm, Gilles Ganault <nos...@nospam.comwrote:
Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that it can
either be access directly, or through the PDO interface.
Can you confirm that the RPM that I used will only allow me to work
through PDO, and not the SQLite library directly, and which is more
recommended?
=====
PHP Version 5.1.6
System Linux asterisk.acme 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22
08:32:04 EDT 2007 i686
Build Date Sep 20 2007 10:01:50
Configure Command './configure' [...] '--without-sqlite' [...]
'--enable-fastcgi' '--enable-pdo=shared'
'--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr'
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr'
=====
Thank you.
PDO vs. sqlite functions?
Probably PDO. Overhead of using it is minimal, and it's a consistent
interface in case you decide to use some other backend later.
I'm not saying that you'll be able to just swap out another database
without problems, but when/if you do then you won't have to learn a
set of new functions.
Just my 2 cents,
Allain
On Sun, 9 Dec 2007 13:07:44 -0800 (PST), allain
<al************@gmail.comwrote:
>Probably PDO. Overhead of using it is minimal, and it's a consistent interface in case you decide to use some other backend later.
Thanks. I probably won't need to switch to another database. I was
just wondering how to work with SQLite from PHP scripts.
Thanks.
On Sun, 9 Dec 2007 13:07:44 -0800 (PST), allain
<al************@gmail.comwrote:
>PDO vs. sqlite functions?
BTW, are the two following versions used when SQLite was compiled into
PHP (which it isn't in the RPM package that I used to install PHP)?
$db = new SQLiteDatabase("db.sqlite");
$db = sqlite_open("db.sqlite"); http://devzone.zend.com/node/view/id/760
On 12ÔÂ9ÈÕ, ÉÏÎç10ʱ54·Ö, Gilles Ganault <nos...@nospam.comwrote:
Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that it can
either be access directly, or through the PDO interface.
Can you confirm that the RPM that I used will only allow me to work
through PDO, and not the SQLite library directly, and which is more
recommended?
=====
PHP Version 5.1.6
System Linux asterisk.acme 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22
08:32:04 EDT 2007 i686
Build Date Sep 20 2007 10:01:50
Configure Command './configure' [...] '--without-sqlite' [...]
'--enable-fastcgi' '--enable-pdo=shared'
'--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr'
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr'
=====
Thank you.
On 12ÔÂ9ÈÕ, ÉÏÎç10ʱ54·Ö, Gilles Ganault <nos...@nospam.comwrote:
Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that it can
either be access directly, or through the PDO interface.
Can you confirm that the RPM that I used will only allow me to work
through PDO, and not the SQLite library directly, and which is more
recommended?
=====
PHP Version 5.1.6
System Linux asterisk.acme 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22
08:32:04 EDT 2007 i686
Build Date Sep 20 2007 10:01:50
Configure Command './configure' [...] '--without-sqlite' [...]
'--enable-fastcgi' '--enable-pdo=shared'
'--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr'
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr'
=====
Thank you.
On 12ÔÂ9ÈÕ, ÉÏÎç10ʱ54·Ö, Gilles Ganault <nos...@nospam.comwrote:
Hello
I was looking for a lighter web server than Apache, and
installed Lighttpd on CentOS through yum. It works fine, but I now
need to use SQLite from a PHP script. I seem to understand that it can
either be access directly, or through the PDO interface.
Can you confirm that the RPM that I used will only allow me to work
through PDO, and not the SQLite library directly, and which is more
recommended?
=====
PHP Version 5.1.6
System Linux asterisk.acme 2.6.18-8.1.15.el5 #1 SMP Mon Oct 22
08:32:04 EDT 2007 i686
Build Date Sep 20 2007 10:01:50
Configure Command './configure' [...] '--without-sqlite' [...]
'--enable-fastcgi' '--enable-pdo=shared'
'--with-pdo-odbc=shared,unixODBC,/usr' '--with-pdo-mysql=shared,/usr'
'--with-pdo-pgsql=shared,/usr' '--with-pdo-sqlite=shared,/usr'
=====
Thank you.
learning
Gilles Ganault wrote:
allain wrote:
>Probably PDO. Overhead of using it is minimal, and it's a consistent interface in case you decide to use some other backend later.
Thanks. I probably won't need to switch to another database.
I'd recommend PDO all the same -- the non-PDO database drivers are already
starting to look quite unmaintained. e.g. the non-PDO driver for SQLite
doesn't support SQLite3, whereas PDO does.
--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 4 days, 2:57.]
Sharing Music with Apple iTunes http://tobyinkster.co.uk/blog/2007/1...tunes-sharing/ This discussion thread is closed Replies have been disabled for this discussion. Similar topics
reply
views
Thread by venkatbo |
last post: by
|
74 posts
views
Thread by ljh |
last post: by
|
4 posts
views
Thread by topmind |
last post: by
|
10 posts
views
Thread by rcnews |
last post: by
|
reply
views
Thread by fmcarol |
last post: by
|
12 posts
views
Thread by John Salerno |
last post: by
|
6 posts
views
Thread by Noble |
last post: by
|
2 posts
views
Thread by Gilles Ganault |
last post: by
|
1 post
views
Thread by Gilles Ganault |
last post: by
| | | | | | | | | | |