Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to view PHP on live site

Tags:

security

php

Is it possible to view the PHP code of a live website ?

like image 738
Oliver Bayes-Shelton Avatar asked Aug 23 '09 21:08

Oliver Bayes-Shelton


People also ask

Can you view PHP code from a website?

Web developers and others who are knowledgeable about web pages know you can use a browser to view the HTML source code of a website. However, if the website contains PHP code, that code is not visible, because all the PHP code is executed on the server before the website is sent to a browser.

How do I view a PHP website?

The only NORMAL way to view PHP source code sitting in some file is to use phps extension, instead of normal php extension. If you make the file extension . phps, decently configured server will output a color-formated source instead of generated html that one would expect.

How do I open a PHP file on a live server?

Inside the file, right click and select 'Open with Live Server' (Shortcut: Alt+L Alt+O). After this opens the browser page, copy the address of this page. Then, open up the php code using XAMPP or WAMPP servers.


1 Answers

No, as it is interpreted on the server-side and the results are sent to the user. If you want to view the source code of a site you control in-browser, consider the FirePHP extension for Firebug, or just access your site files with your preferred method.

like image 59
Jonathan Prior Avatar answered Oct 13 '22 09:10

Jonathan Prior