Moving to a new server: Call to undefined function: stripos() in /home/WP-LC/wp-lc.php on line 2

Moving to a new server is always a challenge. This time I wanted to have a proper version of Python for backend, but the current server only had version 2.4(!). As somebody put it "Wow, that’s ancient!". Anyway, as I wanted to have Django running my application I needed something at least 2.6’ish. I have asked for a new server and after some attempts my hosting provider (Lunarpages) provided me with one. OK, PHP and MySQL seem to be also OK (think of WordPress, etc), so I am settled. Right…

After the move is complete any PHP call resulted in:

Fatal error: Call to undefined function: stripos() in /home/WP-LC/wp-lc.php on line 2

WTF? This should only happen on PHP < 5, but I was promised to have 5. OK, going to shell give me

$ php –version gives me
PHP 5.3.23 (cli) (built: Apr  7 2013 22:08:22) 
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

Well, that should be OK, right? OK, create a file with infamous:

<?php
phpinfo();
?>

but that gives Error 500. Niceeee. What’s now?

Further Googling gives two things:
1. .php files has to have 644 or 755 permissions. By default vi gives 664 :), see also
Lunarpages support article on this topic.

Quick chmod and I finally get the output of phpinfo(), but that one looks rather disappointing:

PHP Version 4.4.9

Wow, that’s old! No wonder I had stripos() errors. Right, going to cPanel still gives me

PHP version	 5.3.25

Where the heck is it??

2. Finally I figured out that .htaccess has to be changed to choose explicitly PHP5 by adding the following lines:

AddHandler application/x-httpd-php5 .php
AddType application/x-httpd-php5 .php

Apparently this was necessary, as after support technician changed the cPanel settings my changes were overwritten with similar ones. So apparently by default PHP4 is set up and pHP5 has to be configured separately. Good to know…

Enjoy!