-->

php-cgi running very slowly on windows

2020-05-02 01:05发布

问题:

I'm trying to speed up my wordpress site because for some reason it's taking on average 5 seconds to load a page (obviously way too slow). I've tracked it down to the php-cgi.exe hogging an incredibly large amount of cpu time, but now have no idea how to figure out why or how to fix it. Any ideas how I could debug the php-cgi.exe and figure out what is slowing it down?

回答1:

PHP itself should definitely not be doing that. Are you sure it is PHP, and not the script you are running?

Try a simple Hello World script and see if you notice the same behavior:

<?php echo "Yellow World"; ?>

If you do, try calling it from the command line and see if you have the same problem:

php.exe helloworld.php

If the CLI version executes nice and fast, but the web based one doesn't, you can begin digging into the trouble between your web server and PHP.

Finally, check and make sure a broken or misconfigured extension isn't hanging things up. Remove all extensions you don't need. If you still have trouble, remove them all and add them back in one by one.



回答2:

Switched to a shared Linux server. All of a sudden everything works without a hitch... start microsoft bashing... now.