How to convert a site from ASP to PHP
ASP is a popular server script language made by Microsoft. PHP is another server script language which is made popular by being free, open and running on many different operating systems such as Linux.
Sometimes you need to convert a site from ASP to PHP. This is a quick way of accomplishing that task that I have used a lot in the past.
1. Get a good text editor
Open every ASP file in an advanced text editor, for example Notepad++.
2. Search and replace ASP and PHP
Do a search and replace where you replace every instance of “.asp” with “.php” in every file. Take note that if you have a lot of ASP tutorials written for your site that text will be replaced to if you have any “.asp” there so it is best to do this by hand in files you are unsure of.
3. Include files
Most modern sites are built with include files. ASP and PHP has different syntax for including files so do a search and replace for every include tag you have but replace it with the PHP variant of the include file.
4. Go to 2
Do step 2 but this time on included files, often include files are put in a sub directory called “/includes”.
5. Change the filetype to PHP
Change the file ending of every ASP file to PHP. For example, change “index.asp” to “index.php”. There are many free tools available to do this task automatically for you.
Now your site should have been converted to PHP. Keep in mind that scripts written in ASP will not function. By having ASP code in external includes files it is easy to replace them in the future. This example works with a static site, changing a dynamic database driven site from ASP to PHP is more advanced but should be possible to do after some analyzing.