Skip to content

GitLab

  • Menu
    • Projects Groups Snippets
      Help
Projects Groups Snippets
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • G gitlabhq1
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 21
    • Issues 21
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 12
    • Merge requests 12
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Packages & Registries
    • Packages & Registries
    • Package Registry
    • Infrastructure Registry
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • gpt
  • large_projects
  • gitlabhq1
  • Issues
  • #811

Closed
Open
Created 13 years ago by Administrator@rootOwner
  • New issue

  • Report abuse

  • New issue

  • Report abuse

Can't view source code of php file

Closed

Can't view source code of php file

Created by: ghost

Hi guys,

Apparently seems that the GitLab "source code viewer" does not like php files.

When I try to access them in the browser from the gitlab interface I receive a gitlab blank page like the image below, and I am redirected to http://domain/projectname/master/tree

alt text

This is what has been recorded into the log:

Started GET "/gitlab2tracker-hook/master/tree/README.md" for 127.0.0.1 at 2012-05-11 15:33:42 +0100
Processing by RefsController#tree as JS
  Parameters: {"project_id"=>"gitlab2tracker-hook", "id"=>"master", "path"=>"README.md"}
  Rendered refs/_tree_file.html.haml (5.7ms)
  Rendered refs/_tree.html.haml (8.9ms)
  Rendered refs/tree.js.haml (9.6ms)
Completed 200 OK in 21ms (Views: 10.2ms | ActiveRecord: 0.4ms)


Started GET "/gitlab2tracker-hook/master/tree?_=1336746815379" for 127.0.0.1 at 2012-05-11 15:33:44 +0100
Processing by RefsController#tree as JS
  Parameters: {"_"=>"1336746815379", "project_id"=>"gitlab2tracker-hook", "id"=>"master"}
  Rendered refs/_tree_item.html.haml (11.9ms)
  Rendered refs/_tree_item.html.haml (10.2ms)
  Rendered refs/_tree_item.html.haml (10.5ms)
  Rendered refs/_tree.html.haml (40.8ms)
  Rendered refs/tree.js.haml (41.7ms)
Completed 200 OK in 57ms (Views: 42.4ms | ActiveRecord: 0.8ms)

Linked issues
...

    Related merge requests

    • Administrator
      Administrator @root · 13 years ago
      Owner

      Created by: vsizov

      i will try today.

      By Administrator on 2012-05-13T05:55:33 (imported from GitLab project)

    • Administrator
      Administrator @root · 13 years ago
      Owner

      Created by: vsizov

      i cannot reproduce.

      By Administrator on 2012-05-13T11:06:45 (imported from GitLab project)

    • Administrator
      Administrator @root · 13 years ago
      Owner

      Created by: ghost

      solved... the problem was that php has been enabled on the nginx server. changing nginx configuration to process only the php files contained into a specific folder solves the problem.

      By Administrator on 2012-05-14T15:09:57 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: mo2o535

      Can you resolved it?? My problem is the same....

      By Administrator on 2013-02-25T17:15:24 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: maykel535

      Can I help me please?? I cannot view de contents the files...

      By Administrator on 2013-02-26T08:53:29 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: maykel535

      This is my log:

      Completed 500 Internal Server Error in 138ms

      ActionView::Template::Error (Failed to get header.): 9: .file_content.code 10: - unless blob.empty? 11: %div{class: user_color_scheme_class} 12: = raw blob.colorize(formatter: :gitlab) 13: - else 14: %p.nothing_here_message Empty file app/models/tree.rb:6:in colorize' app/views/tree/blob/_text.html.haml:12:in_app_views_tree_blob__text_html_haml__4034305902389619354_62142540' app/views/tree/_blob.html.haml:9:in _app_views_tree__blob_html_haml__3087930670128082199_62899880' app/views/tree/_tree.html.haml:19:in_app_views_tree__tree_html_haml__690438233125411681_55336460' app/views/tree/show.js.haml:3:in `_app_views_tree_show_js_haml___2923826176826040621_41632860'

      By Administrator on 2013-02-26T10:31:50 (imported from GitLab project)

    • Administrator
      Administrator @root · 12 years ago
      Owner

      Created by: maykel535

      I resolved this fix. The problem was python. Gitlab call the /usr/bin/python2 when:

      ln -s /usr/bin/python2.7 /usr/bin/python2

      Too:

      ln -s /usr/bin/python2.7 /usr/bin/python

      Thanks.

      By Administrator on 2013-02-26T10:47:50 (imported from GitLab project)

    • You're only seeing other activity in the feed. To add a comment, switch to one of the following options.
    Please register or sign in to reply
    0 Assignees
    Assign to
    Milestone
    No milestone
    None
    None
    Time tracking
    Due date
    None
    None
    0
    Labels
    None
    Assign labels
    • No matching results
    • Manage project labels
    Confidentiality
    Not confidential

    You are going to turn on confidentiality. Only team members with at least Reporter access will be able to see and leave comments on the issue.

    Lock issue
    Unlocked
    participants
    Reference:

    Menu

    Projects Groups Snippets
    Help