Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7519765
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T01:57:25+00:00 2026-05-30T01:57:25+00:00

Syntax highlighting for PHP refuses to work on Wiki pages in my installation of

  • 0

Syntax highlighting for PHP refuses to work on Wiki pages in my installation of Trac. It works beautifully when browsing source, but not in the Wiki. Javascript, C, and Python syntax highlighting work in the Wiki, but not PHP. Woe is me.

I have Trac 0.11.7 installed on Ubuntu 10.04. My web server is Apache 2.2.14.

I have manually installed Pygments. No luck. I have changed the Pygments Theme in preferences. No luck.

I have absolutely 0 errors logged in the trac and apache logs. Logging level for Trac is set to WARNING (and Trac logging is working – I have other errors from earlier today). Firebug also displays no error with everything turned on (except one unrelated “Unknown property ‘-moz-opacity'” CSS error).

Viewing the HTML source of the page shows that the code is simply spit out as preformatted text. It does not have the tons of <span>‘s all other syntax-highlighted code blocks have.

This is the code I’m using in the Wiki:

{{{
#!php
if(true)
{
    echo 'hi';
}
}}}

And this is the result:

<div class="code"><pre><span class="x">if(true)
{
    echo 'hi';
}
</span></pre></div>

Please help 🙂


For an example of what I would expect, here’s some JS code that works:

{{{
#!js
if(true)
{
    alert('hi');
}
}}}

And this is the result:

<div class="code"><pre><span class="k">if</span><span class="p">(</span><span class="kc">true</span><span class="p">)</span>
<span class="p">{</span>
    <span class="nx">alert</span><span class="p">(</span><span class="s1">'hi'</span><span class="p">);</span>
<span class="p">}</span>
</pre></div>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T01:57:26+00:00Added an answer on May 30, 2026 at 1:57 am

    I believe you can resolve this by including the <?php tag:

    {{{
    #!php
    <?php
    if(true)
    {
        echo 'hi';
    }
    }}}
    

    That works for me on my Trac wiki, anyhow. I still haven’t been able to determine if this is intended behavior or a bug, though.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've installed trac on my Ubuntu server but there is no php syntax highlighting.
I need syntax highlighting of source code from various languages (PHP, C#, VB, etc)
The CSS syntax highlighting in vim is not entirely optimal. For example: div.special_class stops
I want to write a syntax highlighting extension for Emacs, but I Googling of
I'm looking for a RichTextBox with syntax highlighting! Sounds easy but I'm searching since
I've got my nice PHP syntax highlighting all set up and it looks great.
I have been looking for a good editor with syntax highlighting for php code
I have started to use Dreamweaver CS5 for PHP coding. The PHP syntax highlighting
I'm searching for a PHP syntax highlighting engine that can be customized (i.e. I
Netbeans 7.0 is highlighting lines as syntax error when i use PHP inside JavaScript

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.