Can someone view the code inside a PHP file on your server?

gwlam12

Diamond Member
Apr 4, 2001
6,946
1
71
I just want to know if it's possible for someone to get the contents of your PHP file off a website.
 

gwlam12

Diamond Member
Apr 4, 2001
6,946
1
71
Okay, cuz the way my user authentication works is that it compares what the user entered to hard-coded strings inside a php file. That's the limit to what my skills allow me to do right now so that's the way I'm doing it. =P


BTW, the link in your sig isn't working.
 
Jun 4, 2005
19,723
1
0
I'm aware of that, I posted it before I was banned and since the thread has been deleted. I'll re-make it once I've got some funds in my paypal account. ;)

But yeah, PHP is incredibly secure, otherwise we'd have people in our databases and stealing our accounts left and right.
 
Jun 4, 2005
19,723
1
0
Well, that's a given. But seeing as how his question was directly concerning PHP, I'd say that's not what he was asking.
 

oog

Golden Member
Feb 14, 2002
1,721
0
0
Well I've seen some software written in PHP that allows file uploads and would even allow the upload of additional PHP files. That would be a security hole caused by PHP that would allow others to possible read the code.
 
Jun 4, 2005
19,723
1
0
Originally posted by: oog
Well I've seen some software written in PHP that allows file uploads and would even allow the upload of additional PHP files. That would be a security hole caused by PHP that would allow others to possible read the code.

There are also some security flaws when it comes to using old perl scripts to break PHP.
 

fs5

Lifer
Jun 10, 2000
11,774
1
0
php is is utterly secure and stable (which is why they release a new version every 3 weeks!!!! ;))
 

Hersh

Senior member
Oct 14, 1999
331
0
0
Depending on how the server is setup, if it is a shared hosting environment and someone on that server has shell access, they will be able to view any file within the server if the shell access is not properly secured (ie. full /bin/bash access and not jailed shell). In this case, they'll be able to view files but won't be able to edit it.

PHP is kept up-to-date fairly quickly... if a flaw is found within the PHP binary, the PHP group gets on top of it quickly and releases fixes. In most cases though, whenever there is an exploit with a php script, it's not the php processor but a poorly coded php script (ie. phpNuke modules have some serious exploits or at least they used to which allowed spammers to spam through vulnerabilities, phpBB had some serious issues with a worm last year, etc).