# Is this a bad idea? Apache PHP error



## pettijohne (Jul 3, 2014)

I was getting the following error in my httpd-error.log:

```
PHP Warning:  PHP Startup: Unable to load dynamic library '/usr/local/lib/php/20100525-zts/pdo_sqlite.so' - Shared object "libsqlite3.so.8" not found, required by "pdo_sqlite.so" in Unknown on line 0
```

So I went investigating and I found pdo_sqlite.so in the directory it was expecting and I also found libsqlite3.so in /usr/local/lib/.  I then went ahead and `ln -s /usr/local/lib/libsqlite3.so /usr/local/lib/libsqlite3.so.8`.

I restarted Apache and there was no more warning. I'm just wondering if this will have adverse effects later down the road.


----------



## wblock@ (Jul 3, 2014)

Yes, it will.  At some point, probably long after you've forgotten doing this, mysterious errors will appear.  Think of it as an engine warning light.  Linking the wrong version is just sticking tape over the light.


----------



## pettijohne (Jul 5, 2014)

Thats what I assumed.  I've tried every legitimate way I can think of to fix the issue with the exception of a complete reinstall.


----------



## wblock@ (Jul 5, 2014)

Remove the  fake links first, then you may have to manually build and install database/sqlite3.

Install sysutils/bsdadminscripts.  Run `pkg_libchk -qo`.  Rebuild the ports it lists.  (You can even do that in one step: `portmaster `pkg_libchk -qo``.

That should do it.  Don't do a full reinstall.  At worst, you could delete and reinstall all the ports on that system.


----------



## wblock@ (Jul 5, 2014)

Oh, and I should always mention this: Upgrading FreeBSD Ports.  It's sort of a distillation of best-practices ports maintenance in a short format.


----------



## SirDice (Jul 5, 2014)

You're either missing databases/sqlite3 or databases/php5-pdo_sqlite hasn't been rebuilt after updating sqlite3. Rebuilt both, starting with sqlite3.


----------



## pettijohne (Jul 6, 2014)

*[solved] Re: Is this a bad idea? Apache PHP error*



> Remove the fake links first, then you may have to manually build and install database/sqlite3.
> 
> Install sysutils/bsdadminscripts. Run pkg_libchk -qo. Rebuild the ports it lists. (You can even do that in one step: portmaster `pkg_libchk -qo`.



This unfortunantly did not show any results.



> You're either missing databases/sqlite3 or databases/php5-pdo_sqlite hasn't been rebuilt after updating sqlite3. Rebuilt both, starting with sqlite3.



I think databases/sqlite3 was the culprit.  I had already rebuilt php5-pdo_sqlite in my original attempts, but not databases/sqlite3.  However, what I find odd is that /usr/local/lib/libsqlite3.so.8 still doesn't exist, but there aren't any complaints in /var/log/httpd-error.log after `apachectl graceful` and just for good measure no complaints after `service apache22 restart`.


----------



## SirDice (Jul 7, 2014)

*Re: [solved] Re: Is this a bad idea? Apache PHP error*



			
				pettijohne said:
			
		

> > However, what I find odd is that /usr/local/lib/libsqlite3.so.8 still doesn't exist, but there aren't any complaints in /var/log/httpd-error.log


That's because the version changed:

```
root@molly:~ # ll /usr/local/lib/libsqlite3.*
-rw-r--r--  1 root  wheel  1282428 Jun 29 03:09 /usr/local/lib/libsqlite3.a
lrwxr-xr-x  1 root  wheel       19 Jun 29 03:09 /usr/local/lib/libsqlite3.so@ -> libsqlite3.so.0.8.6
lrwxr-xr-x  1 root  wheel       19 Jun 29 03:09 /usr/local/lib/libsqlite3.so.0@ -> libsqlite3.so.0.8.6
-rwxr-xr-x  1 root  wheel   924384 Jun 29 03:09 /usr/local/lib/libsqlite3.so.0.8.6*
root@molly:~ # pkg which /usr/local/lib/libsqlite3.so.0.8.6
/usr/local/lib/libsqlite3.so.0.8.6 was installed by package sqlite3-3.8.5_1
```


----------



## pettijohne (Jul 7, 2014)

That would explain it.  I still think it would have been funner to wait and see what broke later on and try to figure it out.  :beer


----------

