php / htaccess problem.
This is the weirdest problem i've encountered and not sure on how to fix it.
spent hours today trying to fix this dam problem will still no success. i reakon i've got about 2 hours tommorow in which it HAS to be sorted.
so please help me out!
Specs: OS: Windows XP Pro Program: EasyPHP (latest version) Server: Apache, running PHP 5 Database: MySQL and PEAR. CMS: OS-Commerce (open source)
Background: Heavily tweaked version of OS-Commerce, running MySQL and added PEAR database configuration too. Has custom htaccess throughout the site, to parse html urls into php scripts for processing and output, using Apache ReWrite function. SSL isnt installed and all SSL connections reverted to HTTP instead.
Problem: the /admin/ panel is htprotceted (obvioulsy). I've configured the htaccess and htpasswd file to how it should be.
When accessing the admin folder im prompted with a login box, as i should be. i enter the correct details and it wont accept anything as a correct answer. i've changed passes, changed htpassed etc and still wont accept correct answers.
So i decided to ditch htaccess and make directory openly accessable, seeing as im only developing on a localhost.
now here is the weird bit. once i've removed the htaccess so theres no prompt or need to login, it acts weird.
i get the whole configuration.php dumped in plaintext in the web pages source, and then after than im left with a big paragraph of chinese charachters.
wtf?
- Why is this happening? I've never seen this before.
- How can i fix it?
Tried and Tested solutions: debugging php scripts. (all seems fine, no errors) editing config details. changing htpasswd paths. FTPing files over to localhost from live site again (incase its happening due to corrupt files)
- considering all the other htaccess files work fine, i cant seem to work out why its happening with just this folder. could it possibly be due to compatibility issues with php4 scripts on php5 server? possibly a server httpd.conf setting i need to chance? php.ini setting i need to change?
im completely lost. google hasnt been any help at all, and even some top coders that i work with dont know why its happening.
any help appreciated.
ok, now im thinking its possibly the 'Content-Type' has been for some reason been changed to something else.
and the chinese characters are actually the script doing what it should.(minus plaintext php). so maybe if i set the 'Content-Type' so a version of ascii then it will display as html?
i dont have access to the files at the moment so im thinking off the top of my head.
Would this be the answer? setting the 'Content-Type'?
I really have no clue, I know you asked me via MSN Messenger but I thought I would post up in here.
If it is a charecter encoding that is causing it to display chinese charecters then I belive you can simply change this to going to View -> Charecter Encoding.
If you cannot figure anything out this way, and if possible…
Can you give me the .htaccess file and if possible the source of the file that is displaying plaintext and chinese charecters?
Just one of them things that I have no clue about just sitting here, but if I see the problem I am sure I could probally fix it.
- I just woke up so im sure my spelling / grammer is extra fucked :) *