#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 , 19 years ago
follow-up: 3 comment:2 by , 19 years ago
| Owner: | changed from to | 
|---|---|
| Status: | new → 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 by , 19 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 , 19 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 , 19 years ago
| Component: | general → 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 by , 19 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 , 19 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 , 19 years ago
| Keywords: | needinfo removed | 
|---|---|
| Resolution: | → worksforme | 
| Status: | assigned → closed | 
| Summary: | problem with previewing the php file → 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).



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