I would like to read the contents of PHP file that is on located on some server: How can I do it ?

The only thing I know is the link.

link|improve this question
Not possible. This is by design for reasons mentioned in the answers below. Please note that this question is off topic for this site, please see the FAQ for more info. – Bryan Jan 26 at 14:15
feedback

closed as off topic by ErikA, Bryan, Khaled, Iain Jan 26 at 14:14

Questions on Server Fault are expected to generally relate to servers, networking, or desktop infrastructure, within the scope defined in the faq.

2 Answers

up vote 2 down vote accepted

You don't if it's being parsed correctly by PHP (Which it should be), unless the server is your own and you have permissions to browse it locally / with FTP / etc That's the whole point.

But I'll assume that the file isn't yours and you don't have access, so the answer is: You Don't.

link|improve this answer
feedback

If you don't own the server and want to be able to view the PHP code using the link only, anyone else can do the same. That would be disaster!! PHP files usually contain sensitive information like DB connection parameters.

You can view the code either by disabling PHP files execution or by accessing the server via SSH and opening the PHP file in a text editor. In both cases, you should have admin access to the server.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.