PHP In Windows Azure Part Two
By Michael Kramer on October 3rd 2014 @ 8:53 am
After working all weekend on getting my framework to run in Windows Azure I am finally able to say I have success!
I kept getting the 500 Error on all my PHP pages. I could Make a new Project in Eclipse, do a phpinfo(); and upload it to the azure cloud, and it would work. I would edit that file, upload, and it wouldn’t work. Error 500.
What was wrong?
Well, as it turns out. That when I would edit IIS settings locally it would change the Web.config file, pointing FastCGI to c:phpphp-cgi.exe and that does not exist on Azure. It took me around 16 hours to finally track down that %RoleRoot%approot ? Doesn’t work for your local machine. So, it is a little annoying, but simply changing it from C:phpphp-cgi.exe to the one that works on Azure (which is, %RoleRoot%approotphpphp-cgi.exe) I finally could start getting my Framework up and running.
My framework was setup originally for MySQL only, With this new framework, I wanted it to work on Azure, and SQL Azure, so I had to teach myself Microsoft SQL. Which I have done. I also had to modify the Framework to work with Multiple Database Engines, as I want it to switch between MySQL and MSSQL easily (and eventually any other Database Engines I feel like adding)
I actually ended up re-building my framework from scratch, so that it would run more efficiently, and be able to handle user roles / permissions better. I also made it so that it would support all the Handlers I had built for the previous Framework without MAJOR changes (which it does).
I can pretty much copy and paste my handlers in, change some of the SQL functions, and a few of the function names (Engine:: is now Virge::) and voila! It will load up, and work on Azure.