The Curly Braces CentOS

Renewing Let's Encrypt certificate

Have the following command setup in my crontab to renew the certificate for this blog, and for the main website -

30 3 1 */2 *  /opt/letsencrypt/certbot-auto renew --pre-hook "service nginx stop" --post-hook "service nginx start"  

This causes the command to run,

At 03:30 on day-of-month 1 in every 2nd month.


Upgrading certbot-auto 0.12.0 to 0.14.1...  
Replacing certbot-auto...  
Creating virtual environment...  
Installing Python packages...  
Installation succeeded.  
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Processing /etc/letsencrypt/renewal/  
Cert is due for renewal, auto-renewing...  
Running pre-hook command: service nginx stop  
Renewing an existing certificate  
Performing the following challenges:  
http-01 challenge for  
http-01 challenge for  
Waiting for verification...  
Cleaning up challenges

new certificate deployed without reload, fullchain is  

Congratulations, all renewals succeeded. The following certs have been renewed:  
  /etc/letsencrypt/live/ (success)
Running post-hook command: service nginx start  

Just putting this here for reference, and with the hope that it might be useful for someone else.

get_results PHP function not working on CentOS

There are instances where the PHP function - get_results will not work on CentOS (this maybe the case with other Linux based operating systems as well). I faced this issue while deploying a project on CentOS which was originally developed on Windows. All my INSERT, UPDATE and DELETE database statements were working properly, but bulk SELECTstatements had issues. After closer inspection I was able to narrow it down to get_results function.

While reading the documentation, I came across this on the get_results documentation page -

MySQL Native Driver Only  
Available only with mysqlnd.  

Using this post on StackOverflow I was able to determine if mysqlnd driver was actually installed and as expected it wasn't.

Posting php code from the StackOverflow post -

if($mysqlnd) {  
   echo 'mysqlnd enabled!';

Here are the steps used to get the mysqlnd driver working on CentOS,

// First remove the existing MySQL driver<br></br>
yum --enablerepo=remi,remi-test remove php-mysql

// Then go ahead and install mysqlnd<br></br>
yum --enablerepo=remi,remi-test install php-mysqlnd

// Restart httpd<br></br>
/sbin/service httpd restart

// If you have phpMyAdmin, re-install it so that it uses the new MySQL driver
yum remove phpMyAdmin  
yum install phpMyAdmin  

Once the mysqlnd driver had been installed I had no issues while using the get_results function.