Jump to content

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/218774-urgent-how-to-block-access-to-php-code/
Share on other sites

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.