Link to home
Start Free TrialLog in
Avatar of ITsolutionWizard
ITsolutionWizardFlag for United States of America

asked on

php on windows

just add the first Wordpress website and php in iis window server.

the website is slow. do you know any good tools and tips I can run some troubleshooting on the server side?

thanks
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

I use Wordpress on a Windows Server myself. Windows is not the issue. Probably best to leave that part out otherwise others will blame Windows. It is true that Nginx can be faster but that means the theme and all the files needs to be tuned.

It would help to see the site live in action. But some general things you can do
  • Make sure all images are properly sized/optimized.  You don't need a 1MB or 2MB image file. 50k to 300k in most instances should be fine.
  • Make sure all of your CSS and JS code is compacted.
  • Determine if some CSS and JS code should be loaded at once vs delayed until after the page loads.
  • Use caching.

If you hit the f12 key while in your browser, then click the lighthouse tab and run that, you will get some good hints of what to do.  Or you can do the same thing directly at https://developers.google.com/speed/pagespeed/insights/

If you do give us your link to your site, we will give you some constructive ideas on how to speed up your site.
Avatar of ITsolutionWizard

ASKER

thanks. of course I will never blame on the Windows. i loaded the codes on both php server and windows server and compare. windows one is just very slow
Is your windows server your local PC?  A local PC running iis/apache is going to be slower than an actual web server running the same.

I have read up on that issue of localhost vs ip and find conflicting data. All you can do is test it out.
I just looked at some of my WP sites and they are set up as below using MariaDB

/** MySQL hostname */


define('DB_HOST', 'localhost:3306');

Open in new window

Another thing to look at is the network.  Again, assuming the Windows server is an actual web server at a web host just as your linux. I would run a tracert from your local machine and also one of the online resources. https://tools.keycdn.com/traceroute to eliminate a bottleneck in the network from you to the server.

Another issue is going to be the web host. If you are on a shared web host where you are paying less than $100US per month, you are on a shared service. Especially if you are on one of the $5 per month hosts, you may have built in bottlenecks.

What theme are you using?
I have Windows server 2012.
Can you share with me where I can find the file so I can change the codes?

/** MySQL hostname */ define('DB_HOST', 'localhost:3306'); 
ASKER CERTIFIED SOLUTION
Avatar of Scott Fell
Scott Fell
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
You asked, "the website is slow. do you know any good tools and tips I can run some troubleshooting on the server side?"


Yes.

Switch to Linux.

With Linux you'll leverage...

1) MariaDB (much faster than MySQL) + Linux Domain Sockets, rather than IP Stack.

2) Apache running MPM Event... which supports...

3) HTTP2 which runs circles around HTTP/1.0 + HTTP/1.1 which both require 1x connection per asset/file served, where HTTP2 multiplexes all assets/files over 1x single connection.

4) Also FPM PHP is much easier to get working + keep working on Linux.

5) Most important. With Linux, especially a sensible Distro/Version like Ubuntu Focal, you simply install all layers of your LAMP Stack + every layer of code... just works... taking around 1-2 minutes to have a working + blazing fast LAMP Stack.

6) Potentially more important, each time any project (Linux/Apache/MariaDB/PHP/OpenSSL) releases any security or performance patch, all that's required to install these... and have them working instantly... on Ubuntu...

apt-get update && apt-get upgrade

Open in new window


That's it...

Running WAMP means you have some oddball installation of all this code.

There are 100s of different WAMP... installation + maintenance approaches, which means it's up to you to constantly dig into every project's code releases, then determine if your WAMP's approach installs these patches.

Running WAMP is all well + good if you have lot's of free time.

Run an Ubuntu Focal LAMP stack if your time is valuable + max security/performance is required 100% of the time.
@David, I agree that all things equal that you could get an ngnx server to out perform other's. However, the difference in speed is not going to be noticed for the majority of sites owners and especially because of how themes and plugins may not be fully optimized.  But your continued claims about Windows are simply not true.

1) MariaDB runs on windows, that is what I use.

2) Windows/iis does run over HTTP2. See my screenshot for https://ee.mypadas.com/ showing the protocol h2
User generated image

3) Windows runs FastCGI, that is what my windows php/wordpress sites run

4) "Running WAMP means you have some oddball installation of all this code
False. You run the same php code on one server as you do the next.

5) Here is a lighthouse report of a vanilla WP site https://ee.mypadas.com/ that even has some blocking because I did not associate woff2 as a font.
If I update this test site to not block woff2, the performance would increase as well as used caching and the other options I mentioned. I also have unused plugins and css because I use this site to test thing as I help people here so it is not optimized for speed.  I agree it will not be as fast as a tuned Ngnx server running the same WP site/theme but the difference will not be very noticeable to most people. Then add a regular theme and plug ins and things start to even out for most web owners.
eemypadas.pdf
User generated image