I've been searching around and there are lots of topics on this, but nothing seems to be helping.
I upgraded PHP to 5.5.8 but it was running really slow so I decided to go back to 5.2 and upgrade to 5.3 and increment up incase I was missing something.
PHP 5.3 is running really slow too and I'm unsure where to look. I'm running IIS 7 with Plesk 11.5
In Plesk, there is no option for anything over 5.2 so I'm using IIS to set the PHP version.
PHP is definitely running on 5.3, is working with FastCGI according to PHPINI():
PHP Version 5.3.28
Server API CGI/FastCGI
_SERVER["REQUEST_URI"] /phpinfo.php/foobar/?foo=bar
error_log C:\Windows\Temp\php53-errors.log
Error log is empty.
Basic PHP works fine, but if I try and execute anything to do with database e.g. a simple connect, it runs extremely slowly (works perfect on localhost).
index.php
<?php
ini_set('display_errors', 1);
error_reporting(~0);
echo phpinfo();
function timer()
{
$time = explode(' ', microtime());
return $time[0]+$time[1];
}
$beginning = timer();
require("db.php");
?>
<html>
<!-- The content of your page -->
Page generated in <?php echo round(timer()-$beginning,6); ?> seconds.
</body>
</html>
Output: Page generated in 4.001114 seconds.
db.php
<?php
require("config.php");
$dbconn = new PDO('mysql:host='.$db_myHost.';dbname='.$db_myDatabase, $db_myUser, $db_myPassword);
try
{
$dbPDO = new PDO('mysql:host='.$db_myHost.';dbname='.$db_myDatabase, $db_myUser, $db_myPassword);
$dbPDO->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
}
catch (PDOException $e)
{
//echo "Error!: " . $e->getMessage() . "
die();
}
?>
config.php
<?php
//PDO Connection
$db_myHost = "localhost";
$db_myUser = "";
$db_myPassword = "";
$db_myDatabase = "";
?>
Are there any other steps I can try to resolve this issue? I'm up trumps with it, and the server company are reluctant to help as it's out of their area.