Monday, November 06, 2006

Broken PEAR Script?

Today i want to test the new FILTER extension which was introduced in PHP 5.2.0, but when i tried, i got an error message: PHP Fatal error: Call to undefined function input_get(), so i looked at PHP's manual on FILTER extension and i got an information that this filter is not installed by default. You will have to install PEAR first and then run pear install filter in order to have this filter installed.

The problem is when i tried to run the batch script provided from PHP, it's broken and i couldn't get PEAR installed on my system. I forgot to capture the screen, but after looking at PEAR's manual, i managed to get PEAR installed by downloading the latest script from go-pear and running it by using php go-pear.php (see screenshot below).

Next i want to list all upgrades available by using pear list-upgrades, but it displayed a warning message : WARNING: channel "pear.php.net" has updated its protocols, use "channel-update pear.php.net" to update , so i run the command and i can remove the warning message when i want to list all available updates again.

Next step is installing the filter extension. When i run pear install filter, it displayed a feedback message:
No releases available for package "pear.php.net/filter" - package pecl/filter can be installed with "pecl install filter"
Cannot initialize 'filter', invalid or missing package file
Package "filter" is not valid
install failed

According to the messages, i had to use pecl command rather than pear and so i do what they ask. But then i got another message :
Failed to download pecl/filter within preferred state "stable", latest release is version 0.11.0, stability "beta", use "channel://pecl.php.net/filter-0.11.0" to install
Cannot initialize 'filter', invalid or missing package file
Package "filter" is not valid
install failed

So finally i run pecl install channel://pecl.php.net/filter-0.11.0 and i ended with :
downloading filter-0.11.0.tgz ...
Starting to download filter-0.11.0.tgz (25,946 bytes)
.........done: 25,946 bytes
8 source files, building
ERROR: The DSP filter.dsp does not exist.

I'm curious, what is this DSP file? So i searched PECL's site and found some information on this page. Here's the answer:
The ".dsp" file is a Ms Visual Studio project that is meant to be compiled on Windows.

So i think in Windows platform, you may have to spend more efforts in order to get Filter installed. I will try to use my Slackware later on and see if it worked.

Has anybody have successfully installed Filter extension on Windows platform? If yes, please give your steps.

Thanks in advance

6 comments:

  1. Anonymous4:22 PM

    You can use precompiled PECL filter extention from http://pecl4win.php.net. You can download here.

    ReplyDelete
  2. Anonymous5:04 PM

    Thanks :D
    I appreciate it

    ReplyDelete
  3. Anonymous5:38 PM

    strange, it will not be loaded also. Maybe it need special configuration? I have enabled php_filter via php.ini but it won't work either

    ReplyDelete
  4. Anonymous12:41 PM

    I've downloaded the php_filter.dll and it worked for me. You need to restart your Apache after to make it work.

    ReplyDelete
  5. Anonymous2:44 AM

    I also get an error with any package I try to install say that [package_name].DSP does not exist.

    Any ideas why this might happen? I have a feeling my PEAR installation is not configured correctly :(btaj

    ReplyDelete
  6. i don't think it's the PEAR's installation, but rather the development problem. They forgot to include their DSP file on the build version

    ReplyDelete