Before you start with AMFPHP...

english mobile

Last week, I had some down time, so I decided to create an AMFPHP example and post it to my website. I have a Windows account with my web host, but they do support php, so I figured it would work. I successfully created the example on my local machine, which I will blog about tomorrow, but I won't be posting the working swf, unfortunately.

Let me tell you why, so that if you need to post to a server that someone else controls, you don't go off all half cocked like I did and make an AMFPHP application that you then can't put out on the Internet.

My first step was to try to export my mySQL database and import it to the server's database. Long story short, the versions didn't match, so I had to find a workaround, which I'll be detailing in the next post.

When I tried to test the service browser, it didn't work. I did a web search for the error I was getting, and I only found one useful link, which suggested that the problem could possibly be with permissions on the folder that contains my mySQL databases. So I went back and checked an old app I had written that writes to a different database. That one totally froze on write. The problem was exacerbated because some time between the last time I worked on a PHP project on my site and now, they'd turned off "display errors." This made the whole problem difficult to debug.

I opened a problem ticket with the web host and got a guy who assumed I was a Jenny Graphic Designer (apologies to serious developers with the name Jenny, but I think you know the attitude I mean) who can barely spell PHP, and so I wasted quite a lot of time getting him to pass me to someone who actually understood the phrase "make sure the default Internet User account has read/write/execute priveleges to the folder containing my database." So once that was resolved, AMFPHP still didn't work.

So, I posted to flexcoders and it seems that the latest AMFPHP requires PHP 5.2.3, and my host had stalled out somewhere in 4. Bottom line, I can't post a working example unless my host upgrades, I switch hosting plans/hosts, or I can find a remoting option which will work on PHP 4.

In summary, here are some things you should do before embarking on an AMFPHP project that will be deployed to a commercially hosted site:

  1. At least know if the version of mySQL on your development and production servers are the same and be prepared to work around it if they're not.
  2. Create a test database on your production server and make sure you can run a simple INSERT query into it from a php page to make sure the appropriate permissions are set on the directory with the database.
  3. Make sure that the right version of PHP is running on your server.

2 comments:

Christopher said...

Sounds like a host change might be in order...

asimo22 said...

I'm so glad you posted this. Do you know of any web hosts that have php 5.2.3 or a little bit later? Please email me if you do, I would be super appreciative.