Edgewall Software

Ticket #3886 (closed defect: worksforme)

Opened 2 years ago

Last modified 4 months 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:

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

  Changed 2 years ago by cmlenz

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

follow-up: ↓ 3   Changed 2 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.

in reply to: ↑ 2   Changed 2 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.

  Changed 2 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 :)

  Changed 2 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...

  Changed 2 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

  Changed 2 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 ;-)

  Changed 2 years ago by sid

  • keywords needinfo removed
  • status changed from assigned to closed
  • resolution set to worksforme
  • 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).

  Changed 4 months ago by anonymous

install php5-cli

Add/Change #3886 (Cannot view PHP source files using the browser)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from anonymous. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.