PHP runs so slowly on my Windows desktop that phpMyAdmin takes minutes to open a database. Here’s a comparison of the time to run a simple PHP test program:
- Windows 8.1 machine running XAMPP: 3597 ms
- iPage shared hosting: 65 ms
- A2Hosting shared hosting: 26 ms
Here’s the test program…
<?php
$rStartTime = microtime(true);
$countTo = 100000;
$a = 0;
//$countTo = $countTo * 100;
for ($x = 0; $x <= $countTo; $x++) {
$a = sqrt(pow($x, 2));
}
$rMs = floor((microtime(true) - $rStartTime) * 1000);
echo 'timer done, countTo=' . $a . ' ms=' . $rMs;
The test program is run without debugging, by entering "http://localhost/timer.php" into Firefox.
The local machine is normally blazing fast. It’s running…
- Windows 8.1
- XAMPP 1.8.3 (control panel v3.2.1)
- Apache 2.4.4 (latest is 2.4.20)
- PHP 5.5.3
- Antimalware = Windows Defender
- IDE = PHPStorm 10.0.2
What's making PHP run so slowly?