{"id":75000,"date":"2026-10-16T03:01:00","date_gmt":"2026-10-15T17:01:00","guid":{"rendered":"https:\/\/www.rjmprogramming.com.au\/ITblog\/?p=75000"},"modified":"2026-10-16T06:20:54","modified_gmt":"2026-10-15T20:20:54","slug":"php-mysql-wordpress-blog-performance-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-mysql-wordpress-blog-performance-primer-tutorial\/","title":{"rendered":"PHP MySql WordPress Blog Performance Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/MySql\/slow_query_logging_on.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP MySql WordPress Blog Performance Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/MySql\/slow_query_logging_on.gif\" title=\"PHP MySql WordPress Blog Performance Primer Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PHP MySql WordPress Blog Performance Primer Tutorial<\/p><\/div>\n<p>To our minds, when thinking about the performance of this blog, which we think could do with some attention given more traffic lately, it being an AlmaLinux Apache\/PHP\/MySql WordPress<a target=\"_blank\" href=\"https:\/\/wordpress.org\/\" rel=\"noopener\">.org<\/a> one, we know of four avenues of research we&#8217;d say are &#8230;<\/p>\n<ul>\n<li>MySql slow queries<\/li>\n<li>PHP slow processing<\/li>\n<li>caching ideas<\/li>\n<li>PHP-FPM (Multi PHP Manager) settings<\/li>\n<\/ul>\n<p> &#8230; the last of which we&#8217;ll leave to last, but some of that can be got to via WHM <a target=\"_blank\" title='cPanel' href='https:\/\/www.cpanel.net' rel=\"noopener\">cPanel<\/a> options.<\/p>\n<p>With the first two, you will probably need to consider the information web server logging can provide you.  By default, we&#8217;re finding, AlmaLinux Apache\/PHP\/MySql web servers of any recent times do not by default log for either of the first two above.<\/p>\n<p>And so, today&#8217;s start down our road examining &#8220;performance&#8221;, we&#8217;ll outline how to set up logging to start investigating whether slow MySql database <font size=1>(further to <a title='PHP MySql Select Query UTF-8 Return Values Tutorial' href='#phpmssqutf-8rvt'>PHP MySql Select Query UTF-8 Return Values Tutorial<\/a>)<\/font> queries are &#8220;too adversely&#8221; affecting your Apache\/PHP\/MySql web server&#8217;s creation of your (perhaps WordPress blog) webpage(s).<\/p>\n<p>Here we got great advice from <a target=\"_blank\" href='https:\/\/www.google.com\/search?q=on+almalinux+where+is+a+log+that+would+detect+slow+mysql+queries%3F&#038;rlz=1C5OZZY_en&#038;oq=on+almalinux+where+is+a+log+that+would+detect+slow+mysql+queries%3F&#038;gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRiPAjIHCAIQIRiPAtIBCjI2NDgwajBqMTWoAgiwAgHxBXnhk69dcs3V&#038;sourceid=chrome&#038;source=chrome.rb&#038;ie=UTF-8' title='on almalinux where is a log that would detect slow mysql queries?' rel=\"noopener\">on almalinux where is a log that would detect slow mysql queries?<\/a> &#8230; thanks &#8230; gleaning &#8230;<\/p>\n<blockquote cite='https:\/\/www.google.com\/search?q=on+almalinux+where+is+a+log+that+would+detect+slow+mysql+queries%3F&#038;rlz=1C5OZZY_en&#038;oq=on+almalinux+where+is+a+log+that+would+detect+slow+mysql+queries%3F&#038;gs_lcrp=EgZjaHJvbWUyBggAEEUYOTIHCAEQIRiPAjIHCAIQIRiPAtIBCjI2NDgwajBqMTWoAgiwAgHxBXnhk69dcs3V&#038;sourceid=chrome&#038;source=chrome.rb&#038;ie=UTF-8'><p>\nBy default, MySQL&#8217;s slow query log is turned off on AlmaLinux. If it has been enabled, you can find the file path by running a quick SQL command, or you can configure it manually.\n<\/p><\/blockquote>\n<p> &#8230; leading us to &#8230;<\/p>\n<ol>\n<li>accessed WHM cPanel -&gt; Edit Database Configuration<\/li>\n<li>set the Slow Query logging to enabled<\/li>\n<li>Save<sup>d<\/sup> that change<\/li>\n<li>accessed WHM cPanel -&gt; Restart Services -&gt; Database Server<\/li>\n<li>click Restart button<\/li>\n<li>then, accessing WHM cPanel -&gt; Terminal, from then on, at it&#8217;s command line &#8230;<br \/>\n<code><br \/>\nls -l \/var\/lib\/mysql\/*.log<br \/>\ncat  \/var\/lib\/mysql\/65-254-93-2-slow.log  # as relevant, in our RJM Programming domain's case, if above not showing zero length log<br \/>\n<\/code><br \/>\n &#8230; were our means of knowing if slow MySql queries are a major issue\n<\/li>\n<\/ol>\n<p> &#8230; and after a day of logging?  We think this is not the major &#8220;performance&#8221; concern for our RJM Programming domain, that slow log still showing no issues.  And so, tomorrow, the quest continues.<\/p>\n<p><!--p>You can also see this play out at WordPress 4.1.1's <a target=\"_blank\" href='\/\/www.rjmprogramming.com.au\/ITblog\/php-mysql-wordpress-blog-performance-primer-tutorial\/' rel=\"noopener\">PHP MySql WordPress Blog Performance Primer Tutorial<\/a>.<\/p-->\n<hr>\n<p id='phpmssqutf-8rvt'>Previous relevant <a target=\"_blank\" title='PHP MySql Select Query UTF-8 Return Values Tutorial' href='\/\/www.rjmprogramming.com.au\/ITblog\/php-mysql-select-query-utf-8-return-values-tutorial\/' rel=\"noopener\">PHP MySql Select Query UTF-8 Return Values Tutorial<\/a> is shown below.<\/p>\n<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a target=\"_blank\" href=\"http:\/\/www.rjmprogramming.com.au\/MySql\/php_mysql_utf8_fix.gif\" rel=\"noopener\"><img decoding=\"async\" style=\"border: 15px solid pink;\" alt=\"PHP MySql Select Query UTF-8 Return Values Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/MySql\/php_mysql_utf8_fix.gif\" title=\"PHP MySql Select Query UTF-8 Return Values Tutorial\"  style=\"float:left;\"   \/><\/a><p class=\"wp-caption-text\">PHP MySql Select Query UTF-8 Return Values Tutorial<\/p><\/div>\n<p>Yes, ever since embracing emojis, we&#8217;re on the lookout for gobbledegook.  And yes, a lot of the strategies we found on the &#8220;stumbled upon&#8221; <a target=\"_blank\" title='Useful link, thanks' href='https:\/\/stackoverflow.com\/questions\/3682409\/reading-utf-8-content-from-mysql-table' rel=\"noopener\">Reading UTF-8 Content from MySql Table<\/a> we were familiar with, but one we weren&#8217;t, which was the one we discovered as gobbledegook in our Landing Page&#8217;s major dropdown outlining all the blog posts we&#8217;ve written at the RJM Programming WordPress Blog Website we&#8217;re running here, and you are reading now.<\/p>\n<p>The, was &#8230;<\/p>\n<p><code><br \/>\nJust Javascript Five Hundred Card Game Open Mis\ufffdre Progress Bar Tutorial (20210507)<br \/>\n<\/code><\/p>\n<p> &#8230; anti gobbledegook initiative scenario, with our changed tutorial_options.php cronatb\/curl morning scheduled Landing Page modifier, becomes &#8230;<\/p>\n<p><code><br \/>\nJust Javascript Five Hundred Card Game Open Mis\u00e8re Progress Bar Tutorial (20210507)<br \/>\n<\/code><\/p>\n<p> &#8230; improvement, came about from a consideration we have not thought about before &#8230; what about if MySql data contains UTF-8 data, and is part of a WordPress blog title, which ends up on the Landing Page big dropdown, already covered by a &#8230;<\/p>\n<p><code><br \/>\n&lt;meta http-equiv=\"Content-Type\" content=\"text\/html; charset=UTF-8\"&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; was inspired by checking off the excellent &#8220;already catered for&#8221; anti gobbledegook (emoji) checklist measures, leaving the PHP &#8230;<\/p>\n<p>&lt;?php<br \/>\n<code><br \/>\n $res =  mysql_query(\"set names 'utf8'\");<br \/>\n<\/code><br \/>\n?&gt;<\/p>\n<p> &#8230; initiative, before any SQL SELECT type queries, idea, presented at <a target=\"_blank\" title='Reading UTF-8 Content from MySql Table' href='https:\/\/stackoverflow.com\/questions\/3682409\/reading-utf-8-content-from-mysql-table' rel=\"noopener\">Reading UTF-8 Content from MySql Table<\/a>, which fixed our issue very nicely, thanks, in <a target=\"_blank\" title='tutorial_options.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/Geographicals\/diff.php?one=http:\/\/www.rjmprogramming.com.au\/PHP\/tutorial_options.php-----------GETME' rel=\"noopener\">our changed<\/a> <a target=\"_blank\" title='tutorial_options.php' href='http:\/\/www.rjmprogramming.com.au\/PHP\/tutorial_options.php-----------GETME' rel=\"noopener\">tutorial_options.php<\/a> PHP crontab\/curl PHP helper.<\/p>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d58110' onclick='var dv=document.getElementById(\"d58110\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/mysql\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d58110' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n<hr>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d75000' onclick='var dv=document.getElementById(\"d75000\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/performance\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d75000' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>To our minds, when thinking about the performance of this blog, which we think could do with some attention given more traffic lately, it being an AlmaLinux Apache\/PHP\/MySql WordPress.org one, we know of four avenues of research we&#8217;d say are &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/php-mysql-wordpress-blog-performance-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,12,29,37],"tags":[85,151,234,249,270,299,5732,1929,716,4085,717,2752,809,827,5729,915,932,1018,2260,2031,5731,5730,1252,2027,1319,1411,1421,1426,1456,3276],"class_list":["post-75000","post","type-post","status-publish","format-standard","hentry","category-database","category-elearning","category-operating-system","category-tutorials","tag-apache","tag-blog","tag-command-line","tag-configuration","tag-cpanel","tag-database-2","tag-elapsed-time","tag-error","tag-log","tag-log-file","tag-logging","tag-monitor","tag-monitoring","tag-mysql","tag-mysql-query","tag-performance","tag-php","tag-query","tag-restart","tag-service","tag-slow-mysql-query","tag-slow-query","tag-terminal","tag-timeout","tag-tutorial","tag-web-server","tag-website","tag-whm","tag-wordpress","tag-wordpress-blog"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/75000"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=75000"}],"version-history":[{"count":8,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/75000\/revisions"}],"predecessor-version":[{"id":75009,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/75000\/revisions\/75009"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=75000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=75000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=75000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}