# Problems with PHP filter extension.



## AJL279 (Mar 13, 2012)

Hello. I'm running PHP 5.3.8 through Apache 2.2.21 on FreeBSD 9.0 . I also posted this message on php-forum.com, but I'm wondering if there is any information on this problem specific to FreeBSD.

I made a PHP form to send email and I got an error stating that the function filter_var() was undefined. I looked at my phpinfo() page and didn't see any information for the filter extension, so my first assumption was that it was not installed with the rest of PHP. I looked for assistance in the PHP manual and it said that the filter extension should be enabled by default.

I installed PHP from ports, which includes the source code for the filter extension, but it does not look like it was compiled (or at least I couldn't find the filter.so file anywhere on my computer). I tried to compile it and got an error code 1. I was able to successfully compile it from a PHP 5.4.0 source (yielding a filter.so file), but PHP 5.3.8 does not load it on startup because the module APIs do not match (according to my httpd-error log).

I don't really know where to go from here; any guidance would be useful. Thanks in advance.


----------



## DutchDaemon (Mar 13, 2012)

`# locate filter.so`

```
/usr/local/lib/php/20090626/filter.so
```

`# pkg_info -W /usr/local/lib/php/20090626/filter.so`

```
/usr/local/lib/php/20090626/filter.so was installed by package php5-filter-5.3.10_1
```

`# psearch php5-filter-5.3.10_1`

```
security/php5-filter      The filter shared extension for php
```


----------



## AJL279 (Mar 15, 2012)

This solved my problem.


----------

