web of unni

About | GuestBook | Add WebOfUnni to Google ToolBar

Download Day

November 27, 2007

Parsing html as php

Filed under: apache, iis, php, windows — unni @ 9:50 pm

Some times we need to parse html files as php. You do the following for the same.

1. Apache
in the website document root create a directory called .htaccess and add the following to that file.

=================================
AddType application/x-httpd-php .inc .php .phtml .html
AddType application/x-httpd-php-source .phps
==================================

Now yout html files will be parsed as php

2. Windows IIS

* Go to IIS manager ( Start >> Programs >> Administrative tools >> IIS manger )
* Right click on the website and get the properties. In the Home directory tab click on application configuration.
* Get the executable path corresponding to php extension.
* Click on add new application extension
* Enter the executable path as that you got from php extension. Enter the extension as .html
* Click Ok.
Now your windows machine will parse your html files as php

October 7, 2007

Unable to start apache getting address already used error

Filed under: apache — unni @ 8:47 am

If you are getting address already used error like below
——————————————————————————
# /etc/init.d/httpd startssl
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
Unable to open logs
——————————————————————————-
you need to check with service is using the port 80
You can check that by following command
——————————————————————————–
netstat -lnp | grep ‘0.0.0.0:80′
——————————————————————————–
It will give the service which is using the port 80
====================================
# netstat -lnp | grep ‘0.0.0.0:80′
tcp 0 0 0.0.0.0:80 0.0.0.0:* LISTEN 17497/brk
====================================
Kill that service and then start apache
=====================================
# ps 17497
PID TTY STAT TIME COMMAND
17497 ? T 0:00 ./brk
# kill -9 17497
# /etc/init.d/httpd startssl
# /etc/init.d/httpd restart
======================================
Hope that will solve the issue. :-)

Created and maintained by Unnikrishnan
Hosted by Host cats