Skip to content
boenrobot edited this page Aug 3, 2012 · 20 revisions

Getting started

Introduction

Allows you to share data across requests as long as the PHP process is running.

Requirements

  • PHP 5.3.0 or later
  • At least one of
    • The APC extension (>= 3.0.13)
    • The WinCache extension (>= 1.1.0)

Installation

Installation with Pyrus/PEAR2 (recommended)

Assuming you have installed Pyrus, you can install PEAR2_Cache_SHM from the pear2.php.net channel with

pyrus install PEAR2_Cache_SHM-alpha

If you've decided to not use the pear2.php.net channel, but instead install directly from the archive distributed at the project page, you can use

pyrus install /path/to/downloaded/archive.tgz

Installation with PEAR

Like most PEAR2 packages, PEAR2_Cache_SHM is compatible with the PEAR installer. However, you have to first discover the PEAR2 channel with

pear channel-discover pear2.php.net

and only then install PEAR2_Cache_SHM with

pear install pear2/PEAR2_Cache_SHM-alpha

Direct PHAR usage

If you download the ".phar" archive, instead of using the PEAR(2) installer, you can just include the archive, and be ready to go, like for example:

<?php
require_once 'PEAR2_Cache_SHM-0.1.0.phar';
//Use any PEAR2_Cache_SHM class

Manual installation

This package has no external dependencies (well, not ones written in PHP), so you can just extract the contents of the "src" folder wherever you like. To emulate the PEAR2 installer, you can place the files in a folder that's within your include_path.

Troubleshooting

If the package doesn't work, you can download the "phar" file (maybe rename it from ".phar" to ".php"), and run it in your browser or command line.

When you do that, you should see the version of the package, along with some messages indicating if you're missing any of the requirements. If all requirements are present, you'll see what adapters can you use under the SAPI you're running the file with.

Clone this wiki locally