I have a PHP script that runs fast on a 2008 Mac Book Pro Laptop but it runs very slow on a brand new Dell desktop. If the PHP environments are the same and I am not using servers what else could be affecting the Dell to make PHP run 2-3 times slower than on the MAC computer?
Details: The PHP working environments are exactly the same i.e. both PHP.ini files are the same, extensions used are the same ect...No it does not involve network connections or database use. There is no out put from other programs and no PHP userland. I have the exact same PHP versions 5.2.9 and same exact extension are installed. I execute PHP scripts from the MSDOS command line interface. Not using any servers.
What the PHP script does is it copies the information from
several files into one file. It then reads that information
nto an array and uses array_count_values to set up an
array_key_exists search. If it is found number is
appended to a file. The data sets are about a million
numbers and this is repeated about 150 times.
Any suggestions to speed up the PHP on the Dell computer would be greatly appreciated.
Does the Dell computer have Microsoft's active process monitoring, or other Anti-virus software running?
If the Dell is Windows 7 64-bit, make sure it isn't this issue:
Also, array_key_exists() is slower than isset(). The first is a function, the latter is a keyword.
Does the dell have a hosts file, and if you are accessing http://localhost is that entry in your hosts file?
If not you might be getting caught in a dns lookup trap.
(needs server restart)
Is your dell perhaps running IIS as well as apache?