One of my customers has recently purchased a VPS for their website.  My Linux VPS is on WebFusion, theirs is on EasySpace.

Now unfortunately EasySpace seem to bugger off at 5pm so I had to rely on Google and hope that some of the Linux boys and girls out there were writing in an intelligible way.

Thankfully for me, I was not let down.

My first source was the AtomiCorp wiki: http://www.atomicorp.com/wiki/index.php/PHP

Then I ran into a little problem with a "dummy" library causing my "yum" to fail.  Similar except here: http://languor.us/error-missing-dependency-glibc-common-2-3-4-2-25-needed-package-glibc-dummy-centos-4

With that removed (on account of it being labelled somethink like xxxxxx-dummy-centos-4) I re-ran the update and succesfully upgraded to PHP 5.2.6

All seems fine (including Plesk) although I expect the packages in Plesk might be out of synch so I'll need to remember the method in case I have to re-install the VPS anytime soon.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Today was actually the first time (that I can remember) I have come across the following error message:

"Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack"

Unfortuntely, today also happened to be a very long day following a very long night (working until 5am last night).

So when this error appeared in a fresh page, based 90% on my previous code I was stumped, angry and frustrated.  Thankfully for me the error was simple to rectify, however it is important to note the error has a purpose rather than it being a bug.

This error crops up when terminating the Response to a page either through Response.End, Response.Redirect or Server.Trasnfer

You may not even notice the error 95% of the time that it occurs.

I had the lethal combination of a try-catch block and a Response.Redirect.  I think I'll explain the significance of the error first and then the simple work-around.

Basically, the Response object is a .NET wrapped set of code that has a certain life-path.  This path is supposed to end with a Response.End (either explicit or implied) that passes execution to the Application_EndRequest method.  When the correct path is not followed, a ThreadAbortException is thrown.

I moved my Response.Redirect out of a try-catch block and appended the optional "terminate execution" parameter of "false" as follows:

Response.Redirect("going-somewhere.aspx", false);

This alleviated my problem and I was able to go back to swearing about something else that wasn't working as expected.

Microsoft's explanation and fixes are listed here: ThreadAbortException when using Response.Redirect

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

My colleague was getting frustrated earlier when trying to replicate the effects of a form from one website into a different website.  She was using a HTML input tag set to type=image, as follows:

<input type="image" src="images/image-name.gif" alt="Send Message" value="Submit" />

Now I don't get involved in HTML that much anymore so I was curious when she said that although the form was posting back when she clicked on the image, the server-side PHP script wasn't recognising the postback.  In fact, the page was just re-rendering.  My colleague has used this same simple HTML on numerous occassions before including a GET-based PHP form to another page.

After a trawl around Google we found suggestions from the HTML definition that you should specify the HTML action in the "value" attribute.  This we did as above to no avail.

Now since I am always suspicious of PHP (amongst other technologies) for handling things just that little bit different I looked for any PHP-related posts on the subject.

 Turns out this is actually because IE (from version 6 onwards at least) doesn't send the value for a HTML input of type=image.  Not like Microsoft to adopt just part of a standard I hear you say with you tongue in your cheek.

Now since the type=image is supposed to return x & y co-ordinates from the browser there is a simple work around.

The server-side code would normally receive the following data from a HTML input tag where type=image:

control_name => value
control_name_x => x co-ord
control_name_y => y co-ord

Since with IE you don't get the value returned you can simply test for the existence of x or y as follows:

 <?php
if (isset($_POST["control_name_x"]))
{
// form submitted 
}
?>

So there we go, PHP not to blame after all.  What was I thinking?

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

I've had my own business since 2003 but since starting Enjoy Online Ltd in 2007 I've found myself working in PHP most of the time.  There are times when I admire the simplicity of PHP - like when I used to program in classic ASP but to be honest, I count the hours until I can write something in C#.

I know that my knowledge of PHP is limited because I've only been using it since 2006 but I wouldn't use the language out of choice.  In the main, my customers have wanted something in PHP because of some plug-in or server restriction or hosting costs.  I now run have two of my own VPS (one on Windows 2003 and one on Ubuntu) so I have more freedom to push a customer in the .NET direction.  My designer develops in PHP however so to keep my developer busy on larger projects, I have to use PHP.  For smaller projects we can combine the design and development quite nicely with me doing all the development in .NET.

I must admit that .NET has been lagging behind the PHP crowd when it comes to sharing usable plug-ins and scripts.  Quite often although you can get hold of a ready-made control or script it will cost you (or cost you more) when you are using .NET.  When I get the time I will be putting up some of my work that I think would benefit others in the community but in all likelyhood there won't be much PHP script going up because there's already a glut of scripts and posts about pretty much everything you would want to do - or at least most of what I've required as I have been bettering myself.

So the reason for this post?  Basically I am hoping that in 2-3 months I can turn around and say "I do 75% of my work in .NET", or that in 2-3 months it won't be a day that I've come home and cursed other developers for their crazy coding in PHP.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

I've now changed my website onto my new VPS system.  Had enough of crap hosting companies with their non-existent backups, constant IP changes without notification and entire shared servers without physical firewalls.  My previous host has the SEO capabilities to be in the top 10 hosting results in Google but they can't take care of their customer's websites.

Many times I lost customer details and blog postings that we 2-3 days old.  Plus the MS-SQL server DBs would get corrupted at the same time as the website would go down - which means that the SQL server was on the same machine as the websites (even though the IPs were deifferent).

Anyway, now on a decent server that I can control without interference.

Thought I'd mark the changeover my dropping my old home-made blog system and using something more powerful.  I'm now using the BlogEngine.Net and will be customising it over the next few months to include some of the features I require.

So if a link doesn't work or a download is un-available, drop me a line and I'll get it sorted.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

AaronReynolds.co.uk

Aaron Reynolds - for C# and VB .NET, HTML, PHP, CSS, ASP, DNS and BIND, Windows Server 2003 etc...