Edgewall Software
Modify

Ticket #3886 (closed defect: worksforme)

Opened 5 years ago

Last modified 4 years ago

Cannot view PHP source files using the browser

Reported by: anonymous Owned by: anonymous
Priority: normal Milestone:
Component: version control/browser Version: 0.10
Severity: normal Keywords:
Cc:
Release Notes:
API Changes:

Description

it should be that i can preview all the source file in the Browse Source page, but i found i can preview all the source file except for the php file, the error is following:

Revision 1, 17.9 kB (checked in by root, 1 week ago)
initial import
HTML preview not available. To view, download the file.

it must be something i have setted wrong but i do not know why.

Attachments

Change History

comment:1 Changed 5 years ago by cmlenz

A good first step would be to enable logging and checking whether anything relevant is in the logs.

comment:2 follow-up: Changed 5 years ago by anonymous

  • Owner changed from jonas to anonymous
  • Status changed from new to assigned

Thank you very much, cmlenz! The reason is that my PHP version is 4.3.9, maybe is too low, then i update it to 4.4.0 and is ok now.

comment:3 in reply to: ↑ 2 Changed 5 years ago by mgood

  • Keywords needinfo added

Replying to anonymous:

Thank you very much, cmlenz! The reason is that my PHP version is 4.3.9, maybe is too low, then i update it to 4.4.0 and is ok now.

What error led you to discover that it was a problem with the version of PHP? If this is a version requirement we should list it in the documentation.

comment:4 Changed 5 years ago by anonymous

edit your trac.ini file

find
[mimeviewer]

php_path = input your php program absoulte path here

my php program path is /usr/local/bin/php

and my php version is 5.1.6, now i fixed this issue :)

comment:5 Changed 5 years ago by kfrancis@…

  • Component changed from general to browser

I am experiencing the same problem as well on CentOS 4 with PHP 4.3.9. My logs indicate:

WARNING: HTML preview using <trac.mimeview.php.PHPRenderer object at 0xb7b6032c> failed (You appear to be using the PHP CGI binary.  Trac requires the CLI version for syntax highlighting.)

I have yet to figure out a way around this, as CentOS seems to only come with the CGI binary...

comment:6 Changed 5 years ago by alientxc@…

yes... read the Warning!

It says that you use a php-cgi binary and NOT the php-cgi binary.

On Debian I must install the package php4-cli (an it is version 4.3.10).

Now all is running ok (without changing trac.ini)

greets, Thomas

comment:7 Changed 5 years ago by alientxc@…

It says that you use a php-cgi binary and NOT the php-cgi binary.

sorry.. i mean you hafe not the php-cli binary ;-)

comment:8 Changed 5 years ago by sid

  • Keywords needinfo removed
  • Resolution set to worksforme
  • Status changed from assigned to closed
  • Summary changed from problem with previewing the php file to Cannot view PHP source files using the browser

Installing PHP worked for me as well. On Windows, I installed PHP into C:\PHP and then added this to my TracIni:

[mimeviewer]
php_path = c:\PHP\php.exe

I had to append the php.exe in the setting. Putting just the path did not work.

I also updated the TracFaq with this question (and the answers from this ticket).

comment:9 Changed 4 years ago by anonymous

install php5-cli

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
to The owner will be changed from anonymous. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.