Book Image

Sphinx Search Beginner's Guide

By : Abbas Ali
Book Image

Sphinx Search Beginner's Guide

By: Abbas Ali

Overview of this book

Table of Contents (15 chapters)
Sphinx Search
Credits
About the Author
Acknowledgement
About the Reviewers
www.PacktPub.com
Preface

Time for action - setting up the feeds application


  1. 1. Create a directory feeds in your webroot, that is, /path/to/webroot/feeds:

    $ mkdir /path/to/webroot/feeds
    
  2. 2. Create the /path/to/webroot/feeds/views directory:

    $ mkdir /path/to/webroot/feeds/views
    
  3. 3. Copy the sphinxapi.php file from the Sphinx source directory to the feeds directory:

    $ cp /path/to/sphinx-0.9.9/api/sphinxapi.php /path/to/webroot/feeds/
    
  4. 4. Get the latest version of SimplePie RSS parser from http://simplepie.org/, extract the archive in any directory of your file system and copy the simplepie.inc file from the extracted archive to the /path/to/webroot/feeds directory:

    $ cp /path/to/simplepie/simplepie.inc /path/to/webroot/feeds/
    
  5. 5. Create the file /path/to/webroot/feeds/init.php with the following code:

    <?php
    /**
    * File: /path/to/webroot/feeds/init.php
    */
    // Database connection credentials
    $dsn ='mysql:dbname=sphinx_feeds;host=localhost';
    $user = 'root';
    $pass = '';
    // Instantiate the PDO (PHP 5 specific) class
    try {
    ...