+ Reply to Thread
Results 1 to 7 of 7

Thread: View php files as another filetype?

  1. #1
    itman647's Avatar
    itman647 is offline x10Hosting Member itman647 is an unknown quantity at this point
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    45

    Unhappy View php files as another filetype?

    I've been looking for this all day, and I have tried many times to add

    AddType application/x-httpd-php .aspx .html .php
    ForceType application/x-httpd-php
    DefaultType application/x-httpd-php
    SetHandler application/x-httpd-php
    Add Handler application/x-httpd-php

    to the lines of my .htaccess file but its either resulted in a 500 Internal Server Error page or a forced download of the page lol

    I've tried all of them in different combinations and now its driving my crazy lol :rant2:

    I'm just wondering is it anything to do with access to certain parts of the server? Because I saw something on the internet called mod_rewrite or something that was related to this and it had something to do with the php.ini file, I cant find the php.ini file? Is it because that ini file determines what php configuration your account has and if you edit it you could prob seriously **** up the server or something? I dunno but anyway all I want to do is run .aspx as a php file.

    P.S my hosting package is FREE, I dont know if that would make a difference?

    Please help :tear:
    Website Not Ready - Coming Soon
    Graphics and Web Design


    :grouphug:
    Proud Member of x10Hosting

    REP ME PLZ


  2. #2
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: View php files as another filetype?

    Quote Originally Posted by itman647 View Post
    anyway all I want to do is run .aspx as a php file.
    PHP is a programming language.
    ASP is a framework to run certain programming languages.

    If you tried to run code designed for aspx, the compiler will find nothing but errors. Most of them due to the fact that the code isn't PHP...
    Surprisingly enough, the PHP interpreter can only interpret PHP.

    Why not just run it as ASP, which you already have?


    I may have misunderstood your point though. Read this topic (asp.net forums) and see if it helps?
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  3. #3
    itman647's Avatar
    itman647 is offline x10Hosting Member itman647 is an unknown quantity at this point
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    45

    Re: View php files as another filetype?

    not just for asp tho, what i really need is a way to run a php programmed page under different or even not-existing extensions like instead of my main index page being index.php i want it to be renamed to index.abcd but still run as a php page?
    Last edited by itman647; 11-05-2008 at 07:18 AM.
    Website Not Ready - Coming Soon
    Graphics and Web Design


    :grouphug:
    Proud Member of x10Hosting

    REP ME PLZ


  4. #4
    Scoochi2's Avatar
    Scoochi2 is offline x10 Sophmore Scoochi2 is an unknown quantity at this point
    Join Date
    Aug 2008
    Location
    Southport!
    Posts
    185

    Re: View php files as another filetype?

    Ah, now I know what you mean. You want PHP to parse pages with different extensions!

    .htaccess is your friend here.
    Code:
    AddType application/x-httpd-php .html .aspx .htm
    That should work for html/htm/aspx pages. If not, it's a X10 issue. Make the .htaccess in the same folder as the files you want to use with it.
    If anyone can see it, my post was meant for anyone who reads it. Don't take it personally or think I'm being condescending... :nuts:

  5. #5
    itman647's Avatar
    itman647 is offline x10Hosting Member itman647 is an unknown quantity at this point
    Join Date
    Jun 2008
    Location
    United Kingdom
    Posts
    45

    Thumbs up Re: View php files as another filetype?

    it still doesn't work, I think it might be something to do with the php.ini file or sumthing. because when i type into the url index.aspx it comes up as a download. and the htaccess file is in the same directory as it and with the line AddType application/x-httpd-php .html .aspx .htm inside it. I dunno what to do? Should I contact x10hosting? Maybe they need change permissions or something?

    When I look at the source code for the index.htm file, it comes up with my php coding at the top but has not outputted it as php instead its outputted it as html but does not appear in the page, only in the source code.

    UPDATE
    I've figured out the problem its the format of the php file
    I checked the headers using the <?php phpinfo(); ?> function and the page was outputted to the browser as application/x-httpd-phpv2. LOL thanks to everyone that tried to help me out.

    AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm
    not
    AddType application/x-httpd-php .aspx .mgl. .psx .htm

    - itman647
    Last edited by itman647; 11-05-2008 at 07:52 AM.
    Website Not Ready - Coming Soon
    Graphics and Web Design


    :grouphug:
    Proud Member of x10Hosting

    REP ME PLZ


  6. #6
    hezuo's Avatar
    hezuo is offline x10 Sophmore hezuo is an unknown quantity at this point
    Join Date
    Dec 2007
    Location
    Huascar, Santa Anita
    Posts
    174

    Re: View php files as another filetype?

    Quote Originally Posted by itman647 View Post

    UPDATE
    I've figured out the problem its the format of the php file
    I checked the headers using the <?php phpinfo(); ?> function and the page was outputted to the browser as application/x-httpd-phpv2. LOL thanks to everyone that tried to help me out.

    AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm
    not
    AddType application/x-httpd-php .aspx .mgl. .psx .htm

    - itman647
    Thanks a lot man! You really help me!! but I think it would be better if they add the .html too, like here:

    AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm .html
    Last edited by hezuo; 12-25-2008 at 10:56 PM. Reason: misspelling

  7. #7
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: View php files as another filetype?

    Code:
    AddType application/x-httpd-phpv2 .aspx .mgl .psx .htm
    is what itman did. x10, or any other host, does not have .htm(l) parsed as php due to the fact that it wastes valuable server resources, because not everyone has .html files with php code inside, but they have just plain html.

    but it's nice to know that they use a different application-type on the servers (v2) (which is probably the php levels if i had to guess).

+ Reply to Thread

Similar Threads

  1. error uploading files with php
    By stalkio in forum Scripts & 3rd Party Apps
    Replies: 2
    Last Post: 08-30-2008, 06:01 AM
  2. Cannot Access PHP Files
    By pasacom in forum Free Hosting
    Replies: 1
    Last Post: 03-18-2008, 09:58 PM
  3. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  4. How to protect images without htaccess using PHP
    By frznmnky in forum Tutorials
    Replies: 0
    Last Post: 12-26-2007, 11:51 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers