title: PHP + SQLite3 on Amazon AMI (EC2)
body: <p>I have a similar question to <a href="https://stackoverflow.com/questions/2785473/how-to-enable-core-php-extension-in-linux">this one</a>, I want sqlite3 php support on my EC2 (standard Amazon AMI), but PHP was compiled with <code>--without-sqlite3</code>.</p>
  
  <p>How can I add sqlite3 support? Its software from repository so I can't just rerun the <code>./configure</code> script</p>
  
  <p>More info:</p>
  
  <p>I tried installing it from PECL without much success, and besides it says the version is <code>0.6 (alpha)</code> and that sqlite3 support was only briefly available through PECL and should be compiled into the PHP executable (I think). Its confusing.</p>
  
  <p>I also have the PDO extension (some site said sqlite3 is in PDO)</p>
  
  <p>Here is what I tried with PECL:</p>
  
  <pre><code>ec2-user[~]&gt; pecl search sqlite
  Retrieving data...0%
  ..Matched packages, channel pecl.php.net:
  =======================================
  Package    Stable/(Latest) Local
  PDO_SQLITE 1.0.1 (stable)        SQLite v3 Interface driver for PDO
  SQLite     1.0.3 (stable)        SQLite database bindings
  sqlite3    0.6 (alpha)           SQLite v3 Database Bindings.
  ec2-user[~]&gt; pecl download sqlite3
  Failed to download pecl/sqlite3 within preferred state "stable", latest release is version 0.6, stability "alpha", use "channel://pecl.php.net/sqlite3-0.6" to install
  download failed
  ec2-user[~]&gt; pecl download channel://pecl.php.net/sqlite3-0.6
  downloading sqlite3-0.6.tgz ...
  Starting to download sqlite3-0.6.tgz (768,302 bytes)
  .........................................................................................................................................................done: 768,302 bytes
  File /home/ec2-user/sqlite3-0.6.tgz downloaded
  ec2-user[~]&gt; sudo pecl install sqlite3-0.6.tgz
  84 source files, building
  running: phpize
  Configuring for:
  PHP Api Version:         20090626
  Zend Module Api No:      20090626
  Zend Extension Api No:   220090626
  Optionally provide the path to the libsqlite3 library [autodetect] : yes
  building in /var/tmp/pear-build-root8Jljf1/sqlite3-0.6
  
  (...)
  
  /var/tmp/sqlite3/sqlite3.c:1586: error: duplicate 'static' // repeated lots of times
  make: *** [sqlite3.lo] Error 1
  ERROR: `make' failed
  </code></pre>
  
  <p>Edit: There is no <code>php-sqlite</code> or <code>php5-sqlite</code> package</p>
  
  <pre><code>ec2-user[~]&gt; sudo yum search sqlite
  Loaded plugins: fastestmirror, priorities, security, update-motd, upgrade-helper
  Loading mirror speeds from cached hostfile
   * amzn-main: packages.us-west-2.amazonaws.com
   * amzn-updates: packages.us-west-2.amazonaws.com
  ========================================================================= N/S Matched: sqlite ==========================================================================
  apr-util-sqlite.x86_64 : APR utility library SQLite DBD driver
  libdbi-dbd-sqlite.x86_64 : SQLite plugin for libdbi
  python-sqlite.x86_64 : Python bindings for sqlite.
  python24-sqlite.x86_64 : Python bindings for sqlite.
  sqlite-devel.x86_64 : Development tools for the sqlite3 embeddable SQL database engine
  sqlite-doc.x86_64 : Documentation for sqlite
  sqlite-tcl.x86_64 : Tcl module for the sqlite3 embeddable SQL database engine
  perl-DBD-SQLite.x86_64 : Self Contained RDBMS in a DBI Driver
  sqlite.i686 : Library that implements an embeddable SQL database engine
  sqlite.x86_64 : Library that implements an embeddable SQL database engine
  </code></pre>
  
  <p>Edit 2: no package as above is also available after enabling the (disabled by default) <a href="http://aws.amazon.com/amazon-linux-ami/faqs/#epel" rel="nofollow noreferrer">Extra Packages for Enterprise Linux (EPEL) repository</a></p>