SitePoint Sponsor

User Tag List

Results 1 to 8 of 8
  1. #1
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Can't view php source type files

    I'm having a problem viewing php source files. Right now the php-source type uses the .phps extension. I start the server and I try to goto a .phps file. Instead of getting a syntax highlighted page, it asks if I want to download the file. Does anyone know why it would do that?

  2. #2
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Open your httpd.conf file and check if you have the following line
    Code:
    AddType application/x-httpd-php-source .phps
    Paul

  3. #3
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've had that exact line in there for a very long time. It's just that it never worked properly.
    I've been trying to get it to work correctly and haven't been able to.

    Oh and I'm using Apache 2.0.40 and PHP 4.2.3. It never worked when I had Apache 2.0.39 and PHP 4.2.1 either.
    Last edited by Justintime; Sep 19, 2002 at 22:26.

  4. #4
    Happy Holidays !! Paul S's Avatar
    Join Date
    Mar 2001
    Location
    Mexico
    Posts
    1,287
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    May there's a problem with your httpd.conf file or with that version of Apache and php, I've tested it with Apache 1.3.X and php 4.1.0 and it worked.
    Why don't you send me a PM with your httpd.conf attached, I'll try to check it over the weekend.

    Paul

  5. #5
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP needs to be installed as an Apache module

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  6. #6
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It has been installed as a module though.

  7. #7
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Stab in the dark, but possibly the browser thinks it is a type of page it should download for some odd reason. Just to rule this out, open the page in notepad and see what it gives you. Eg in the open dialog box type the address of the page...
    Oh no! the coots are eating my nodes!

  8. #8
    SitePoint Member
    Join Date
    Aug 2002
    Posts
    12
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well it's not the browser because I've tried IE, Netscape, and Opera, plus I've had friends try to view it but they also get the "Do you want to download?" window. As an alternative, as you said, I can open it in notepad without the syntax highlighting of course. I guess we can come to a conclusion that php-source viewing with syntax highlighting does not work in the Apache 2.0.xx versions. Unless someone has gotten it to work with the latest versions of Apache... I've even tried upgrading to Apache 2.0.43 and the latest stable PHP version and still no dice . Thanks to everyone for all the help anyway.
    Last edited by Justintime; Oct 9, 2002 at 23:49.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •