Edgewall Software
Modify

Opened 18 years ago

Closed 17 years ago

Last modified 16 years ago

#3886 closed defect (worksforme)

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: Branch:
Release Notes:
API Changes:
Internal 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 (0)

Change History (9)

comment:1 by Christopher Lenz, 18 years ago

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

comment:2 by anonymous, 18 years ago

Owner: changed from Jonas Borgström to anonymous
Status: newassigned

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.

in reply to:  2 comment:3 by Matthew Good, 18 years ago

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 by anonymous, 18 years ago

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 by kfrancis@…, 17 years ago

Component: generalbrowser

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 by alientxc@…, 17 years ago

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 by alientxc@…, 17 years ago

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 by sid, 17 years ago

Keywords: needinfo removed
Resolution: worksforme
Status: assignedclosed
Summary: problem with previewing the php fileCannot 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 by anonymous, 16 years ago

install php5-cli

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anonymous.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from anonymous to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.