LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-26-2008, 02:52 PM   #1
tekmann33
Member
 
Registered: Nov 2006
Posts: 188

Rep: Reputation: 30
Apache problem


I have a server (Fedora 8 Platform) that runs Analog (WebStat Analyzer) and Apache 2.2.8.

Analog creates an html file that I can display with Apache. However, when I display Analogs html stats page, I get the following line in the browser:

Code:
Parse error: syntax error, unexpected T_STRING in /usr/local/apache2/htdocs/ob_proxyStats.html on line 1
When I open up the html page, the lines it is refering to are not php lines, but xml. Here are the first 10 or so lines of the file:
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet href="#internalStyle" type="text/css"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Web Server Statistics for Test Library</title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<meta name="robots" content="noindex,nofollow" />
<meta name="generator" content="analog 6.0/Unix" />
<style type="text/css" id="internalStyle">
h2 {
        background-color: #A0C0F0;
        width: 98%;
        padding: 3px 6px;
}
table {
        text-align: right;
When I delete the fist two xml lines, the page renders without a problem.

Not sure why apache can't handle xml lines. I've used analog with apache on another machine, but I believe with the same version of analog and a later version of apache, so I am not sure what the problem is with xml tags and apache.

Does anybody see why I am getting this Parse error with these xml lines in this file?
 
Old 07-27-2008, 03:31 AM   #2
comprookie2000
Gentoo Developer
 
Registered: Feb 2004
Location: Fort Lauderdale FL.
Distribution: Gentoo
Posts: 3,291
Blog Entries: 5

Rep: Reputation: 58
Does the page validate?
http://validator.w3.org/
 
Old 07-27-2008, 11:13 AM   #3
tekmann33
Member
 
Registered: Nov 2006
Posts: 188

Original Poster
Rep: Reputation: 30
This is just a test server on a local / private network. I can't validate it unless it is public.
 
Old 08-03-2008, 12:08 PM   #4
trevelluk
Member
 
Registered: Nov 2003
Location: Bristol, UK
Distribution: Debian Lenny, Gentoo (at work)
Posts: 388

Rep: Reputation: 32
Despite what it might look like, the error is coming from PHP, not Apache. It would seem that Apache has been configured to treat .html files as PHP, and PHP has been configured to allow "short tags" to open a block of PHP code, which will mean the "<?" construct will be seen as the start of a block of PHP. See http://www.php.net/manual/en/language.basic-syntax.php for more information on short tags.

You've got a few choices here:
1. Configure Apache not to run .html files through the PHP parser. This will of course require administrative access to any servers this application will be running on, and may have implications for any other applications on the server.

2. Alter your PHP settings file (php.ini) to not allow short tags. This will again require administrative access to the server, and may affect other applications.

3. Accept that the page will be parsed as PHP, and get the XML declarations output in that way, something like the following:
PHP Code:
print '<?xml version="1.0" encoding="ISO-8859-1"?>';
print '<?xml-stylesheet href="#internalStyle" type="text/css"?>';
As the file in question is (presumably) automatically generated by Analog, then this would mean delving into the Analog source code and modifying it (I'm assuming its open source, but to be honest I'm not familiar with it). This option would have the requirement that any server where the application will be run must execute .html files as PHP.

Hopefully the above makes some kind of sense.

Incidentally, it is possible to upload a file to the W3C validation service to perform validation of local files, at http://validator.w3.org/#validate_by_upload
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache file permissions problem. {Apache/2.2.6 Fedora 8} hacker supreme Linux - Server 5 01-31-2008 03:26 PM
apache/mod_python problem: ImportError: No module named mod_python.apache BrianK Linux - Software 2 10-10-2007 05:13 PM
Strange apache trailing / problem - Slack-current, apache 1.3.33 vamp Linux - Networking 1 01-30-2005 07:28 PM
RH9: PHP session problem (or Apache problem) fengcn Red Hat 0 12-01-2003 06:32 PM
perl problem? apache problem? cgi problem? WorldBuilder Linux - Software 1 09-17-2003 07:45 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:56 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration