install

Installing PHP APC On RHEL/CentOS

  1. Yum up some packages:
    ```

    yum install php-pear php-devel httpd-devel

              </td>
            </tr>
          </table>
        </div>
    
      2. Install APC using pear (the pear installer is smarter than the pecl installer):
      
        When the installer asks about APXS, say ‘no’. </p> <div class="wp_syntax">
          <table>
            <tr>
              <td class="code">
                ```
    pear install pecl/apc
    
          </td>
        </tr>
      </table>
    </div>
    
    1. Tell PHP to load APC:
      ```

      echo extension=apc.so > /etc/php.d/apc.ini

                </td>
              </tr>
            </table>
          </div>
      
        4. Restart Apache: <div class="wp_syntax">
            <table>
              <tr>
                <td class="code">
                  ```
      /sbin/service httpd graceful
      
            </td>
          </tr>
        </table>
      </div>

      Installing memcached On CentOS/RHEL

      Using info from CentOS forums, Sunny Walia and Ryan Boren, here’s how I got memcached running on my Dotster VPS:

      Install libevent:

      ``` wget http://www.monkey.org/~provos/libevent-1.3e.tar.gz tar zxvf libevent-1.3e.tar.gz cd libevent-1.3e   ./configure make make install ```

      Install memcached

      ``` wget http://danga.com:80/memcached/dist/memcached-1.2.5.tar.gz tar zxvf memcached-1.2.5.tar.gz cd memcached-1.2.5   ./configure make make install ```

      We will start the server to use 30 megs of ram (-m 30), listen on ip 127.0.0.1 (-l 127.0.0.1) and run on port 11211 (-p 11211) as user ‘nobody’ (-u nobody):

      ``` memcached -u nobody -d -m 30 -l 127.0.0.1 -p 11211 ```

      Get an error?

      ``` memcached: error while loading shared libraries: libevent-1.3e.so.1: cannot open shared object file: No such file or directory ```

      Show it the path to the library:

      ``` LD_LIBRARY_PATH=/usr/local/lib export LD_LIBRARY_PATH ```

      JSON on RHEL & PHP 5.1.6

      Stuck with PHP 5.1.6 on RHEL or even CentOS (and a sysadmin who insists on using packages)? Need JSON? I did. The solution is easy:

      yum install php-devel<br /> pecl install json

      The pecl install failed when it hit an 8MB memory limit, and I was clueless about how to fix it until I learned that the pecl installer ignores the php.ini. Turns out the best solution is to use the pear installer (which does follow php.ini settings):

      pear install pecl/json