Forum Moderators: coopster

Message Too Old, No Replies

Host dead, pondering an ASP to PHP recode

I swear I seem to go through hosts like tissue paper...

         

Dreamquick

1:40 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well one of the hosts I was using has been down for a few days now and isn't answering their calls so I figure it's time to cut my losses and run. The main reason I went with these guys was they offered a great deal on MSSQL as part of the package, and being a hardcore SQL person I jumped at the chance.

However now they're toast and I can't find another host offering the same deal at that price I'm pondering biting the bullet and moving to Apache+PHP+mySQL with an ISP I've dealt with in the past.

I figure I can probably turn one of the sites into straight HTML and upload it as a stop-gap measure since there weren't any major interactive dynamic elements, however the other two sites on there were dynamic and interactive and hooking into the database at a few points.

A straight recode from ASP to PHP seems the best approach for the long term, but I don't actually know PHP at this point in time... (cue ominous music) ...I've wanted to learn PHP+mySQL for a while, but never really gotten around to it until now. Is this the perfect opportunity to learn PHP or just wishful thinking?

None of the two sites do anything that tricky - leafing through an o'reilly php book this morning suggests that the majority of the things I'll need are very much do-able (URL parsing, string manipulation, math).

Any thoughts / advice from the PHP crowd? Any of you been in the same boat?

- Tony

celerityfm

1:51 pm on Sep 17, 2004 (gmt 0)

10+ Year Member



If you can do MSSQL and ASP then you can do MYSQL and PHP no problem. The biggest change is that you won't have enterprise manager/query analyzer on your side for building MYSQL databases. There are several ways to setup databases in MYSQL but my favorite helper app (amongst all the others) is a great little PHP program called PHP MySQL Table Manager [appcreator.com].

A little bit of googling for MYSQL tutorials, PHP tutorials and MYSQL+PHP tutorials and you'll be well on your way to moving over to that instead. I started out using ASP/MSSQL but recently setup a few sites using PHP/MYSQL.. there was a small learning curve but eventually it'll just be like ASP to ya :P

coopster

2:18 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Been in the same boat? If you mean "translate code from one language to another", then yes. However, to answer your second question,

>>Is this the perfect opportunity to learn PHP or just wishful thinking?

I wouldn't say it's the perfect opportunity. The situation is less than ideal in that you have the additional pressure of the site being down while you push through a learning curve. Scripting languages as a whole are quite relative in their feature/function sets. As a matter of fact, compiled languages are as well. It's the syntax and getting yourself accustomed to the docs/manuals/support areas that take a bit more time.

(pause) Feel like I am stating the obvious here ... oh well, worth stating I guess.

The easiest part of any transition is knowing what you want to do so that you can search or ask questions. If you understand the ASP code you will be able to rewrite it in another language. And since you wrote it in the first place then the understanding part shouldn't be much of an issue.

The database queries may need to be tweaked if you used any non-standard SQL. Also, if you didn't use an abstraction layer, you may want to consider it in your redesign.

Any other thoughts...?

Dreamquick

3:39 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thankfully most of the db work on these is straight single-table SELECT, DELETE or UPDATE calls and while MSSQL isn't a perfect ANSI SQL implementation it's close enough that I should be able to bluff my way through on the differences once I've gotten a "read from table" procedure working.

Although I'm mostly a basic-oriented programmer I've done a reasonable amount of C work and a little perl too so the general structure of PHP isn't throwing me into total culture shock from what I've seen / read so far - like you say, its a question of getting the commands and syntax down.

Thanks for the suggestions / support ... I'll keep checking back to see if anything new crops up!

- Tony

Iguana

4:01 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A few months ago I had to dump a host because they didn't seem capable of keeping ASP sites running. I switched to PHP/MySQL and a Linux host. I translated the most important pages to PHP in a few days (although I still keep an ASP site on a different host - I will get round to translating those). I found it pretty easy and have been impressed with everything PHP can do (a lot of things that you need extra COM components with ASP can be done with straight PHP). Everything has been running smoothly - and its cheaper too!

timster

5:38 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The switch from VB to PHP shouldn't be to shocking since you have that C & Perl experience. (That's basically how I came to PHP.) PHP is definitely very slick.

Still, you're probably in a hurry to get your sites up and running quickly. You might consider translating your applications to Perl since you know that language. Many Unix/Linux hosts offer both PHP and Perl. Then you can learn PHP at a more leisurely pace. (Check out mod_perl if you're interested this.)

Your data would only need to move once, since both PHP and Perl talk to MySQL very nicely.

mincklerstraat

5:44 pm on Sep 17, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Not familliar with the MS products, but if you need some kind of 'query analyzer', check out the EXPLAIN syntax at mysql.org which will help you adjust your tables to your queries and vice-versa to get the most optimized use of your indexes for JOIN statements.

hiker_jjw

8:44 pm on Sep 18, 2004 (gmt 0)



I'd take this as an opportunity rather than a problem! If you're going to move from ASP to PHP, go ahead and take the time to do a redesign while you're at it. You'll be amazed at how friendly PHP is for Web development.