Linux, FreeBSD, Juniper, Cisco / Network security articles and troubleshooting guides

FAQ
It is currently Sun Dec 10, 2023 6:46 am


This forum is dedicated to Apache, Nginx, Lighttpd, Squid and other HTTP transport protocol related software

Author Message
LaR3
  Post  Post subject: Fatal error: Call to undefined function filter_var() in php script  |  Posted: Fri Oct 02, 2009 10:52 am

Joined: Mon Aug 03, 2009 4:55 pm
Posts: 19

Offline
 

Fatal error: Call to undefined function filter_var() in php script

Fatal error: Call to undefined function filter_var() in a php file

This php error is outputed because your PHP installation does not have the filter extension loaded.

On my setup, I have PHP 5.2 installed from sources and the filter module was not built at the same time with php (reading the internet, seems that php 5.2.X doesn't install it automatically).

Sometimes, using the pecl installer is not an option. This could be because you're behind a firewall, or it could be because the extension you want to install is not available as a PECL compatible package, such as unreleased extensions from SVN. If you need to build such an extension, you can use the lower-level build tools to perform the build manually.

The phpize command is used to prepare the build environment for a PHP extension. In the following sample, the sources for an extension are in a directory named filter

So, go to to php extension source and to filter module's directory:

Code:
# sudo cd /usr/src/php-5.2.10/ext/filter
# sudo /opt/php-5.2.x/bin/phpize
# sudo ./configure --with-php-config=/opt/php-5.2.x/bin/php-config
# sudo make
# sudo make install


The above commands will:
1) cd
2) phpize will prepare the php build environment for the filter php extension
3) configure the source code and create the necessary files for compiling (Makefile) with the path of the php-config binary
4) compile
5) install the filter extension to php extension's directory.

Now, check the the filter.so file is where all the other php extensions are, and edit your php.ini file, go to Extensions section, and add the line:
Code:
extension=filter.so

Then, gracefully (or not), restart your apache and test with a webpage calling a filter function, or call your php binary with the '-m' argument:
Code:
# sudo php -m | grep -i filter
filter

_________________
Humble user
http://www.ivorde.ro





Top
Display posts from previous:  Sort by  
E-mail friendPrint view

Topics related to - "Fatal error: Call to undefined function filter_var() in php script"
 Topics   Author   Replies   Views   Last post 
There are no new unread posts for this topic. Apache to Nginx Server parameters translation with php function

debuser

0

105153

Thu Aug 26, 2010 7:47 am

debuser View the latest post

 

Who is online
Users browsing this forum: No registered users and 0 guests
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum
Jump to:  
cronNews News Site map Site map SitemapIndex SitemapIndex RSS Feed RSS Feed Channel list Channel list


Delete all board cookies | The team | All times are UTC - 5 hours [ DST ]



phpBB SEO