Koozali.org: home of the SME Server

index.php does not show up?

WACOMalt

index.php does not show up?
« on: July 12, 2006, 07:57:25 AM »
Hi, I have an index.php file in my html folder for www.wacomalt.com

however it does not show anything when I go to wacomalt.com

when I had a html file as the index, it showed propperly.

do I need to change something to be able to use index.php?

Offline mmccarn

  • *
  • 2,656
  • +10/-0
index.php does not show up?
« Reply #1 on: July 12, 2006, 08:16:51 AM »
If your page loads when you specify "index.php" in the URL then you may need to find out how to modify /etc/httpd/conf/httpd.conf to allow you to use "index.php" as a default index file.  The "DirectoryIndex" directive lists the files that should be used by default in any given "Directory" in your webserver.

If the page doesn't load even when you include the full filename, then perhaps your Ibay doesn't have "Execution of dynamic content (CGI, PHP, SSI)" enabled - index.html is static, but index.php is dynamic...  Modify the ibay settings using server-manager.

The last thing that occurs to me is that it could be a file permission issue - make sure "index.php" has the right permissions and ownership.  I'm no expert on this, but the web packages I've installed on my SME seem to set permissions & ownership something like this:

# chown www:shared index.php
# chmod 640 index.html

WACOMalt

index.php does not show up?
« Reply #2 on: July 12, 2006, 08:38:06 AM »
my page does not load either way.  SO I assume there is something on the server itself not working.

the ibay I use is the primary Ibay, so I cannot choose to turn on the execution of dynamic content. I will try this real fast on my other ibay , which has dynamic content enabled.

aaand it didnt work there either. so either this is a server issue not relation to my ibay settings, or it is a problem with my actual php file.

EDIT: could this be a problem because I am on 7 rc1?

and is there a way to update just using the server manager?

Offline Curly

  • ****
  • 114
  • +0/-0
index.php does not show up?
« Reply #3 on: July 12, 2006, 09:29:13 AM »
Problems in the index.php should be visible in the log file /var/log/messages. Problems with http-server should be visible in the log /var/log/httpd/error_log.

If no messages appear in those logs, you should tell us what happens:
- error message
- blank screen
- timeout
.......................................

WACOMalt

index.php does not show up?
« Reply #4 on: July 12, 2006, 10:06:42 PM »
ok, I looked at those logs. I saw "unexpected : at line 5"

on line five, I have a : for the http://www.wacomalt.com/news/feed.xml

here is the total code of that index.php EDIT: now this is the code for index.htm I still get the same eroor on the messages though, so same problem still.

Code: [Select]
<?php
require&#40;$_SERVER['DOCUMENT_ROOT'&#93; . '/php/simplepie.inc'&#41;;

$feed = new SimplePie&#40;&#41;;
$feed->feed_url&#40;’http&#58;//www.wacomalt.com/feed.xml’&#41;;
$feed->cache_location&#40;$_SERVER[’DOCUMENT_ROOT’&#93; . ‘/cache’&#41;;
$feed->init&#40;&#41;;

$feed->handle_content_type&#40;&#41;;

?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”
“http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>

<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<title>My Feed Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><font face="arial" color="red" size="24px">As you can see, I am in the process of fixing some things...<p>  The forums are still fine though. <a href="http://www.wacomalt.com/phpBB2/">CLICK HERE TO VISIT THE FORUMS</a></font>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br><?php if &#40;$feed->data&#41; &#123; ?>

    <!– Get the title of the whole feed and link it back to the website –>
    <h1>
        <a href=”<?php echo $feed->get_feed_link&#40;&#41;; ?>“>
            <?php echo $feed->get_feed_title&#40;&#41;; ?>
        </a>
    </h1>

    <!–
    Loop through each news item in the feed, and limit the quantity to
    either 5, or as many items as are in the feed — whichever is less.
    –>
    <?php
    $max 
$feed->get_item_quantity&#40;5&#41;;
    
for &#40;$x = 0; $x < $max; $x++&#41; &#123;
    $item $feed->get_item&#40;$x&#41;;
    
?>


        <!– Get the title of the news item and link it back to the original post –>
        <h2>
            <a href=”<?php echo $item->get_permalink&#40;&#41;; ?>“>
                <?php echo $item->get_title&#40;&#41;; ?>
            </a>
        </h2>

        <!– Get the date that it was posted –>
        <p><?php echo $item->get_date&#40;’j M Y’&#41;; ?></p>

        <!– Show the news posting –>
        <p><?php echo $item->get_description&#40;&#41;; ?></p>

        <!– Add links to add this post to one of a handful of services. –>
        <p>
            <a href=”<?php echo $item->add_to_delicious&#40;&#41;; ?>“>Del.icio.us</a> |
            <a href=”<?php echo $item->add_to_digg&#40;&#41;; ?>“>Digg this!</a> |
            <a href=”<?php echo $item->add_to_newsvine&#40;&#41;; ?>“>Newsvine</a>
        </p>

    <!– Stop looping through each item once we’ve gone through all of them. –>
    <?php &#125; ?>

<!– From here on, we’re no longer using data from the feed. –>
<?php &#125; ?>

</body>
</html>


I also wonder if my primary ibay is able to execute dynamic content? and why is this not modifiable through server-manager?

EDIT: I now changed the file to index.htm rather than index.php, now it shows up, but as you can see, there are still problems, and why did this exact same page not show up when named index.php?

Offline JonB

  • *
  • 351
  • +0/-0
index.php does not show up?
« Reply #5 on: July 13, 2006, 02:34:41 AM »
1 - You can run dynamic content in the Primary Ibays.
2 - Your URL on line 5 is incorrect
3 - Do you have the correct permissions on the file.
...

WACOMalt

index.php does not show up?
« Reply #6 on: July 13, 2006, 04:18:40 AM »
Quote from: "JonB"
3 - Do you have the correct permissions on the file.


I chmodded it to 777. I did that through a windows ftp connectionthough, would that matter?

EDIT: this is a quote from the installation guide for simplepie "We’ll need to change the file permissions (aka CHMOD permissions) for the cache directory to be server-writable."

what is the code for server writable? or should 777 work? what is the command line stuff to chmod or chown(?) it to the right permissions?

Offline JonB

  • *
  • 351
  • +0/-0
index.php does not show up?
« Reply #7 on: July 13, 2006, 02:19:30 PM »
WACOmalt,

You are going to have to fix the script. You are getting parse errors. The first thing to fix are all the single quotes. Go through the script and replace all of them.

You need to run the script as .php not .html.

777 will be fine to start off with but you should be able to back the permissions off once you get it working.
...