Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




The Unofficial Ubuntu Starter Guide
Prev Home Next

Q: How to parse RSS into PHP for Apache HTTP Server?

  1. Read General Notes
  2. Read How to install Apache HTTP Server for HTTP (Web) Server service?
  3. Read How to install PHP for Apache HTTP Server?
  4. e.g. Assumed that RSS is - News
  5. wget -c
    sudo mkdir /var/www/feeds
    sudo tar zxvf magpierss-0.71.1.tar.gz -C /var/www/feeds/
    sudo mv /var/www/feeds/magpierss-0.71.1/* /var/www/feeds/
    sudo rm -fr /var/www/feeds/magpierss-0.71.1/
    sudo chown -R www-data:root /var/www/feeds/
    sudo gedit /var/www/feeds/index.php
  6. Insert the following lines into the new file
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
    <html xmlns="" lang="en" xml:lang="en">
    <title> - News</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
    <style type="text/css">
    body {
      background: #ffffff;
      margin-left: 20px;
      font-family: bitstream vera sans,sans-serif;
      font-size: 9pt;
    h1 {
      font-family: luxi sans,sans-serif;
      font-size: 15pt;
    require_once '';
    $url = '';
    $rss = fetch_rss($url);
    if ($rss) {
      echo "<h1>";
      echo "<a href=$url>", $rss->channel[title], "</a><br/>";
      echo "</h1>";
      foreach ($rss->items as $item ) {
        $url = $item[link];
        $title = $item[title];
        $description = $item[description];
        echo "<li>";
        echo "<b>Topic:</b> <a href=$url><b><u>$title</u></b></a><br/><br/>";
        echo "$description<br/><br/>";
        echo "</li>";
    else {
      echo "<a href=$url>", $url, "</a> - Server Down!<br/>";
  7. Save the edited file (sample)
  8. https://localhost/feeds/index.php

FTP Server

The Unofficial Ubuntu Starter Guide
Prev Home Next

  Published under the terms of the GNU General Public License Design by Interspire