search

Home  >  Q&A  >  body text

How to view PHP source code on a live site?

<p>Is it possible to view the PHP code of a live website? </p>
P粉512526720P粉512526720456 days ago518

reply all(2)I'll reply

  • P粉759451255

    P粉7594512552023-08-25 00:35:13

    Typically, no, as others have said, unless that's the case you want. You can then set it up so that using .phps (or any other extension, but that's the norm) will display the source code of the page (with syntax coloring I believe). Something like this:

    AddHandler application/x-httpd-php-source .phps

    In your apache configuration should solve the problem.

    Please note that you need to save the .php file using .phps in order to display its source code.

    reply
    0
  • P粉852114752

    P粉8521147522023-08-25 00:33:57

    No, because it is interpreted on the server side and the result is sent to the user. If you want to view the source code of a site you control in the browser, consider the FirePHP extension href="http://getfirebug.com" rel="noreferrer">Firebug, or just use Access your website files using your preferred method.

    reply
    0
  • Cancelreply