# How to know php/ext/sqlite3 make success or not after SQLCipher process please

**URL:** <https://discuss.zetetic.net/t/how-to-know-php-ext-sqlite3-make-success-or-not-after-sqlcipher-process-please/3330>\
**Category:** SQLCipher\
**Created:** [January 2, 2019, 11:10am UTC](https://discuss.zetetic.net/t/how-to-know-php-ext-sqlite3-make-success-or-not-after-sqlcipher-process-please/3330 "2019-01-02T11:10:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jeongkuk\_Seo](https://sea2.discourse-cdn.com/flex016/user_avatar/discuss.zetetic.net/jeongkuk_seo/32/1041_2.png) [@Jeongkuk\_Seo](https://discuss.zetetic.net/u/Jeongkuk_Seo)\
**Post date:** [January 2, 2019, 11:10am UTC](https://discuss.zetetic.net/t/how-to-know-php-ext-sqlite3-make-success-or-not-after-sqlcipher-process-please/3330/1 "2019-01-02T11:10:49Z")

</div>

Hello SQLCipher team… First i really thanks to give me a mail why [https://www.zetetic.net/sqlcipher/sqlcipher-for-php/](https://www.zetetic.net/sqlcipher/sqlcipher-for-php/) page is not available.  
i almost spend 5days only for using php with SQLCipher. I almost follow and success process but php source give me this error.

> **Warning** : SQLite3::query(): Unable to prepare statement: 26, file is encrypted or is not a database in **/home1/apache/htdocs/db.php** on line **7**  
> Exceptionfile is encrypted or is not a database

And this is the source.

```
<?php

try {

  $db = new SQLite3("test2.db");
  $db->exec("PRAGMA key = 'test';");
  $result = $db->query("select * from t1;");
  if(!$result) {
    throw new Exception($db->lastErrorMsg());
  }
  var_dump($result->fetchArray());
  $db->close();
}
catch(Exception $e) {
  echo "Exception", $e->getMessage(), "\n";
}

?>

```

When i see a last section of SQLCipher with php, i can see this.

> PHP monitors the `/etc/php5/apache2/conf.d` directory for additional configuration files to load. Create a file in that directory called `sqlcipher.ini` will the following content.

But I dont have a /etc/php5 directory. My environment is CentOS6, apache 2.4.37, php-5.6.8  
So i change extension\_dir in php.ini like this.

> ; Directory in which the loadable extensions (modules) reside.  
> ; [http://php.net/extension-dir](http://php.net/extension-dir)  
> extension\_dir = “/root/php-5.6.8/ext/sqlite3/modules” // this is the my php path with ext/sqlite3

and then i insert this code in php.ini

> extension=sqlite3.so

And then i restart apache… But as i mentioned, php code give me a fail message…  
So i wonder how can i know php/ext/sqlite3/modules/sqlite3.so file is success with sqlcipher?  
or please give me how can i solve this problem.

If you help me, i really happy u.u omg…
