Fatal Error

Undefined function filter_input()

Page 1 of 1

4 Replies - 2366 Views - Last Post: 12 June 2010 - 02:17 PM Rate Topic: -----

#1 Stoutn  Icon User is offline

  • New D.I.C Head

Reputation: -5
  • View blog
  • Posts: 18
  • Joined: 07-June 10

Fatal Error

Posted 09 June 2010 - 06:50 PM

Fatal error: Call to undefined function filter_input() in *site* on line 2

<?php
$RMili = filter_input(INPUT_GET, "inputMilitary");
$RWeap = filter_input(INPUT_GET, "inputWeapons");
$ROff = filter_input(INPUT_GET, "inputOffence");
$RDef = filter_input(INPUT_GET, "inputDefence");
$RRes = filter_input(INPUT_GET, "inputResidential");
$RAg = filter_input(INPUT_GET, "inputAgriculture");
$RInd = filter_input(INPUT_GET, "inputIndustrial");
$RMed = filter_input(INPUT_GET, "inputMedical");
$REsp = filter_input(INPUT_GET, "inputEspionage");
$RRef = filter_input(INPUT_GET, "inputRefinery");
$RLand = filter_input(INPUT_GET, "inputLand");
?>



This works fine on my localhost, but on the actual server it doesn't, anyone care to point me in the direction of fixing this error? :P


Note: Yes PHP 5.2+ is installed.

Is This A Good Question/Topic? 0
  • +

Replies To: Fatal Error

#2 Atli  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 3716
  • View blog
  • Posts: 5,976
  • Joined: 08-June 10

Re: Fatal Error

Posted 09 June 2010 - 07:46 PM

Hey.

The Filter extension should be included by default in all PHP >= 5.2 installations, so I see only 4 options:
  • You are using an older version.
  • The extension has been disabled.
  • Your PHP installation is defective.
  • There is a bug in your version of PHP.


In all cases, my recommendation is the same. Upgrade your PHP to the latest version (5.3.2, as of this post.)
If that's not possible, you will have to go over your server's configuration and enable the extension. If it is enabled, that leaves only one option.

But first, double check your actual PHP version. Best to do that from within a script, like so:
<?php
if(!function_exists("filter_var")) {
    echo "Filter extension not found. (PHP " . phpversion() .")";
}
else {
    echo "Filter extension loaded. All is well! :)/>";
}
?>

Was This Post Helpful? 3
  • +
  • -

#3 Stoutn  Icon User is offline

  • New D.I.C Head

Reputation: -5
  • View blog
  • Posts: 18
  • Joined: 07-June 10

Re: Fatal Error

Posted 10 June 2010 - 05:00 PM

"Filter extension not found. (PHP 5.2.8-pl2-gentoo)"

So I guess it isn't enabled.





View PostAtli, on 09 June 2010 - 06:46 PM, said:

Hey.

The Filter extension should be included by default in all PHP >= 5.2 installations, so I see only 4 options:
  • You are using an older version.
  • The extension has been disabled.
  • Your PHP installation is defective.
  • There is a bug in your version of PHP.


In all cases, my recommendation is the same. Upgrade your PHP to the latest version (5.3.2, as of this post.)
If that's not possible, you will have to go over your server's configuration and enable the extension. If it is enabled, that leaves only one option.

But first, double check your actual PHP version. Best to do that from within a script, like so:
<?php
if(!function_exists("filter_var")) {
    echo "Filter extension not found. (PHP " . phpversion() .")";
}
else {
    echo "Filter extension loaded. All is well! :)/>";
}
?>

Was This Post Helpful? 0
  • +
  • -

#4 Valek  Icon User is offline

  • The Real Skynet
  • member icon

Reputation: 542
  • View blog
  • Posts: 1,713
  • Joined: 08-November 08

Re: Fatal Error

Posted 11 June 2010 - 02:09 AM

Do a phpinfo() and show me what it's giving you for the configure command line. I suspect you've got a little bit of #3 from Atli's list going on there.

This post has been edited by Valek: 11 June 2010 - 02:12 AM

Was This Post Helpful? 0
  • +
  • -

#5 Stoutn  Icon User is offline

  • New D.I.C Head

Reputation: -5
  • View blog
  • Posts: 18
  • Joined: 07-June 10

Re: Fatal Error

Posted 12 June 2010 - 02:17 PM

Got the problem solved. Few tweaks and good to go! Thanks for the helps guys :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1