-1

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.

1
  • 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, 2012 at 14:15

2 Answers 2

4

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.

1

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.

Not the answer you're looking for? Browse other questions tagged .