Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to view PHP code (the actual code not the compiled result) from a client machine?

Tags:

security

php

This may be a really stupid question...I started worrying last night that there might be someway to view PHP files on a server via a browser or someother means on a client machine. My worry is, I have an include file that contains the database username and password. If there were a way to put the address of this file in to a browser or some other system and see the code itself then it would be an issue for obvious reasons.

Is this a legitimate concern? If so how do people go about preventing this?

like image 234
Columbo Avatar asked Dec 28 '22 16:12

Columbo


1 Answers

Not if your server is configured right. I think discussion on how that is done belongs on serverfault.

like image 65
Andrew McGregor Avatar answered Jan 13 '23 16:01

Andrew McGregor