1

I know this question has been already asked here. I am trying to use a script in my localhost. The script contains .htm files and an .htaccess file with the following code to parse those .htm files as PHP.

AddHandler application/x-httpd-php5 .htm .php .html

Now this is not working at all and i get a blank web page whenever i run it from my localhost. i.e "localhost/paystill_enterprise" and it give me blank webpage.

Now i have tried every solution i could find on internet like editing httpd.conf file etc. Here are some of the solutions i have tried.

1- I have tried editing httdp.conf and have added the following code one by one

 <IfModule mime_module>
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php .html
  AddType application/x-httpd-php .htm
  AddType application/x-httpd-php .txt
 </IfModule>

 <FilesMatch "\.html$">
   ForceType application/x-httpd-php
 </FilesMatch>

 <FilesMatch "\.htm$">
    ForceType application/x-httpd-php
 </FilesMatch>

2- Tried adding these lines of code one by one in my .htaccess file

 AddType application/x-httpd-php .html .htm

 AddType application/x-httpd-php5 .html .htm

 RemoveHandler .html .htm
 AddType application/x-httpd-php .php .htm .html

No matter what i use, always get a blank page for "localhost/paystill_enterprise".

Note: Sometimes it also happens that when i type the address "localhost/paystill_enterprise", the browsers asks me to save the file i.e the browser tries to download it. Any suggestions?

1

Please reverse everything you have done thus far. Please uninstall IIS Server using Programs and Features, until you understand that IIS operates on port 80(default), and that Apache is also attempting to operate on port 80. You must either choose:

  • To Configure IIS to operate on port 80, and set Apache to operate on port 8080.
  • To Configure Apache on port 80, and set IIS to operate on port 8080
  • To uninstall IIS(the option I recommended, until you've done this a few times).

After removing or configuring the items as suggested, choose to install/reinstall WAMP Server, after reading this primer tutorial. If you choose to follow the steps in the tutorial, you won't need to install WAMP Server, as the tutorial actually teaches you what WAMP Server's purpose is. Please make note of the Testing step:

To ensure that PHP is running on the server, you can create a php file with the following contents:

<?php phpinfo(); ?>

If this returns a blank page, go no further until it returns output, as your configuration(most likely a port issue, See above regarding ports) is invalid. Regarding using the extension .htm as a php file is not acceptable as all php files end in .php, while htm still gets served as a plain html file. An html file cannot contain any php code, but a php file can contain html.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.