king.oslo Posted November 15, 2010 Share Posted November 15, 2010 Hello, On my VPS, most of the php files that are requested, i.e. index.php are returned to the client as interpreted php code (ie HTML, for example). However, in a few directories, when a clients requests a file, i.e. database.php, the actual php-code is returned (where database username and password are present) which is a major issue!!!! How can I change this so that the server returns interpreted php-code, not raw php code? Very greatful for quick replies! Thanks, Kind regards, Marius Quote Link to comment https://forums.phpfreaks.com/topic/218774-urgent-how-to-block-access-to-php-code/ Share on other sites More sharing options...
PFMaBiSmAd Posted November 15, 2010 Share Posted November 15, 2010 The php language engine is either specifically disabled for those folders or it was never enabled for those folders. Are there any .htaccess files that have statements in them with any php language related settings that could be disabling php in those folder(s)? Do any of the httpd.conf and related apache configuration files have any conditional statements that only enable the php language in specific folder(s), such as your document root folder? Short answer: You need to investigate the configuration settings on your server to find out either why php is only enabled in certain folders or to find out why it is disabled in other folders. Quote Link to comment https://forums.phpfreaks.com/topic/218774-urgent-how-to-block-access-to-php-code/#findComment-1134657 Share on other sites More sharing options...
king.oslo Posted November 15, 2010 Author Share Posted November 15, 2010 Thanks.M Quote Link to comment https://forums.phpfreaks.com/topic/218774-urgent-how-to-block-access-to-php-code/#findComment-1134688 Share on other sites More sharing options...
PFMaBiSmAd Posted November 15, 2010 Share Posted November 15, 2010 Another possibility is if you are using short open tags <? in the code that simply being output instead of being seen as php code. Quote Link to comment https://forums.phpfreaks.com/topic/218774-urgent-how-to-block-access-to-php-code/#findComment-1134691 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.