mysqllearner
mysqllearner

Reputation: 13913

Why I can view my php source code online?

I purchased a very well-known 3rd-party php-based forum software. Uploaded to my server, run it for few weeks. This morning, when I visit my site, it display all the PHP code, including all the comments etc, like what you will see if you open it with notepad. It was very scary, my database config which is in PHP file also visible, what happened? I have no choice but to take my website down now.

What should I do? How can view PHP code? I thought PHP code is very safe?

Has somebody hacked my website?

Upvotes: 1

Views: 1692

Answers (3)

Martin Bean
Martin Bean

Reputation: 39399

Quick fix is to place a blank index.html in your website (and forum root directory if different). It won't stop people accessing your source code if they know the script names and know this error is in place, but at least it won't be displayed to every man and his dog as they visit your website/forum.

Other than that, you've had the PHP parsing module on your server disabled, either incorrectly or accidentally. Contact your host immediately, but I presume you would have already done this.

Upvotes: 0

Rubens Farias
Rubens Farias

Reputation: 57976

Somebody disabled your script interpretation on your webserver. Ask your host admin.

Upvotes: 0

Wim
Wim

Reputation: 11252

That's a configuration problem at the server (like mod_php not being loaded for some reason). Best contact your hosting provider immediately and let them know they have a serious problem!

Unless you have uploaded your own .htaccess file, which could also be the source of problematic Apache configuration settings?

Upvotes: 5

Related Questions