WordPress.org

Ready to get started?Download WordPress

Forums

Show php codes with phps (7 posts)

  1. ludvig87
    Member
    Posted 10 years ago #

    Ive made tutorials on customizing your wp, so I would like to be able to show the codes online, but...
    Ive saved the files as phps, but when I try to look at them online, there pops up a message on whether I want to save or open the document.. How do I change that, so the codes just show??

  2. Lester Chan
    Member
    Posted 10 years ago #

    hmm, y not just renamed to .txt?

  3. Cena
    Member
    Posted 10 years ago #

    The ability to display .phps in a browser depends on your Apache server settings.
    LoadModule php4_module /usr/local/apache/libexec/libphp4.so
    <IfModule mod_mime.c>
    AddType application/x-httpd-php .php
    AddType application/x-httpd-php-source .phps
    </IfModule >
    has to be included in the httpd.conf file, which you may not have access to. You'd need to contact your server administrator to have it included.

  4. ludvig87
    Member
    Posted 10 years ago #

    Thanks. Ill try out both...

  5. Lester Chan
    Member
    Posted 10 years ago #

    if not u can uise php functions called show_source() i think

  6. Matt Mullenweg
    Troublemaker
    Posted 10 years ago #

    You can also post it to the wiki, which does syntax highlighting. (Check out the my-hacks.php page.)

  7. sunshine
    Member
    Posted 10 years ago #

    <IfModule mod_mime.c>
    AddType application/x-httpd-php-source .phps
    </IfModule >
    Is all you'll need. :)

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.