Showing posts with label PEAR. Show all posts
Showing posts with label PEAR. Show all posts

Thursday, September 24, 2009

Mindmap of my projects

Here is a mindmap of my projects. I intend to keep this map up-to-date.

Monday, March 31, 2008

PROXY for PEAR channel


I recently submitted a bug report on PEAR regarding a long standing issue with the PEAR installer tool: there is no support for HTTP 302 (redirect). This condition effectively limits the hosting possibilities of PEAR channels e.g. a PEAR channel can not be accessible through a DNS cname aliases.

Problem

Suppose I have hosted a PEAR REST channel on Google Project @ http://mediawiki.googlecode.com/svn and now I would like to make this channel friendly through a nicer URL like " mediawiki.pear.jldupont.com ".
(note that the above is just an example: the channel on which I used the method described below in not yet publicly available)

Solution

The solution involves setting up a PROXY. This time around I have managed the feat with Apache using proxy_module 'mod_proxy.so' : in my vhost configuration, I have added:

<VirtualHost mediawiki.pear.jldupont.com:80>

ServerName mediawiki.pear.jldupont.com

DocumentRoot /var/www/vhosts/mediawiki.pear.jldupont.com

#PERFORMANCE tuning
#NOTE: not strictly required for the PROXY functionality
SetOutputFilter DEFLATE

ProxyRequests Off
ProxyPass / http://mediawiki.googlecode.com/svn/
ProxyPassReverse / http://mediawiki.googlecode.com/svn/

</VirtualHost>

Thursday, March 13, 2008

PEAR channels updated automatically

A marvelous new tool is available to the general public since yesterday: SproutBuilder. I decided to give it a try:






Above is a sprout automatically updated of all the PHP PEAR channels I know. The list is composed of entries I add to my Del.icio.us links with the tag pear-channel. Then this list is processed through a YAHOO! Pipe and finally embedded in the ''sprout''.

Monday, March 10, 2008

1and1 Linux VPS

It would appear that 1AND1 Linux VPS come now with Fedora Core 6 - 64bits. I really don't mind except when:
- PEAR isn't installed
- PECL neither (of course) ... and does not work even after fixing PEAR

Some good news though: yum is installed by default. Hooray!

Installing PEAR
Step 1: cd /tmp
Step 2: wget http://pear.php.net/go-pear
Step 3: php go-pear
Step 4: When prompted for the installation prefix, use /usr/share
Step 5: Try-out the pear command: pear

Installing PECL extensions
Getting PECL extensions to compile is a little bit more tricky...
Step 1: yum install gcc
Step 2: yum install php-devel

Even with this effort, I wasn't able to use the pecl command and had to resort to go through the pear command instead. See example next.

Installing PECL / APC
Step 1: pear install pecl/apc
Step 2: cp /usr/lib/php/modules/apc.so /usr/lib64/modules/php/apc.so
Step 3: vi /etc/php.d/apc.ini
Step 4: following step 3, edit apc.ini with extension=apc.so




Friday, November 30, 2007

Pear Channel on GoogleCode

I recently devised a way to host a Pear Channel on GoogleCode.

What is Pear?

Pear stands for PHP Extension And Repository. It consists of well, you guest it, extensions and a repository for those. The beauty of Pear comes from its managed installation process: one can easily upgrade PHP Extensions using the services of Pear. For those not yet acquainted with PHP, you can consult the official PHP site.

Why GoogleCode?

The reasons I wanted to host a Pear Channel on GoogleCode where simple:

  • Low cost: GoogleCode Project hosting is free
  • Capacity: 100MB of storage per project
  • SVN access
  • Bandwidth

Challenge #1: Pear documentation

In general, the documentation related to the Pear Extensions themselves is good. What was lacking in this instance was the documentation on the REST interface. I had to reverse engineer the PHP code of Pear as well as well as tear apart the Pear’s WEB site REST repository.

Challenge #2: Pear bug

Pear is a marvelous tool to say the least but in the case at hand here, a bug slowed me down quite a bit. The Pear installation tool can’t process files of MIME type ‘text/plain’ when served with HTTP-compression Transfer-Encoding (see the standard). This is quite annoying as by default GoogleCode Apache servers do serve those files transfer-encoded using the ‘chunked’ method.

I have filed a bug report on this issue here.

The Quick Fix

The quick fix, whilst waiting for Pear v1.7.0, is to set the MIME-type of the text files required by the Pear REST interface to ‘application/gzip’. This effectively fools GoogleCode into believing that the said files are already compressed. This trick forces GoogleCode servers to send the text files without further transfer-encoding.

Presentation

I have also done a presentation on this subject: Pear Channel Presentation on GooglePresentation .