Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 260
  • Last Modified:

Viewing raw PHP code externally

I know this is a stupid question since it is a feature of PHP. It is server sided scripting.
But is there anyway to see the raw PHP code of a site?
I don't want to steal code or anything. I'm a web developer myself.

On a normally configured apache server with PHP can I see the code?
Using special switches or command line or web spiders/parsers? Anyway to make the server not execute the code before sending to the client?
0
BiSHGoD
Asked:
BiSHGoD
  • 3
  • 2
  • 2
1 Solution
 
ZylochCommented:
Hi BiSHGoD,

Impossible on a correctly configured Apache server.

Regards,
Zyloch
0
 
BiSHGoDAuthor Commented:
Typically people have webdav on a different port/server without the php module running for editing php pages. Can I see the webpages using webdav if theyre using it, or do I need a username/pass? I don't use it myself.
0
 
BiSHGoDAuthor Commented:
Also how bad would the apache server have to be misconfigured to allow it? If the server executes php normally. What type of thing could I do to check for a misconfigured server. Or does that mean hacking, which would be beyond this.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
jdpipeCommented:
Some stoopid people will have their server configured so that checking .php to .phps at the end of the URL will let you see the source code. But don't expect that to happen very often.
JP
0
 
jdpipeCommented:
> I don't want to steal code or anything. I'm a web developer myself.

Who else would want to steal code anyway? ;-)
0
 
ZylochCommented:
Nah, web developers are proud of their code :)

But seriously, it's definitely not safe to let others see your code. As PHP is now, you can even hard code usernames and passwords (although not recommended) into the PHP file itself and it would be safe.

I really see no reason to view a php file since you most likely have access to it anyways :)

Regards...
0
 
BiSHGoDAuthor Commented:
Ok. I'll take that as my stuff is safe.

Thanks for the info.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now