SSL unable to get local issuer

If you have installed an SSL certificate and appears to work fine in the browser, but does not work on places like the W3 feeds validator or iTunes Connect, a good way to debug it is to use cURL from the command line.

You may get back an “unable to get local issuer certificate” error.

$ curl https://www.your-domain.com/
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.haxx.se/docs/sslcerts.html

If so, this means that you have successfully installed your SSL certificate, but you have not included the intermediate certificates. These form an essential part of the chain up to the root certificate and need to be included when you install it.

They are typically distributed in .bundle files that come with your .crt file.

Create hook templates in Git

Hooks are scripts that you can use to run additional code when running Git commands. They are not stored in the repository so need to be set up on each computer individually.

You can create templates for your hooks that will be used whenever you create a new repository. To do this, put your scripts into the template folders on your local machine.

On Linux:

/usr/share/git-core/templates

On Windows:

Program Files (x86)\Git\share\git-core\templates

When you next run git init you will then have these templates installed by default. Additionally, you can run git init in existing repositories to update the templates (it will not do any damage to the repo itself).

Troubleshooting xdebug profiler

Xdebug can be used to profile your PHP applications. However, it can be difficult to configure and get working. There are a number of gotchas to look out for.

Enabling

To enable the profiler on every request you can use the setting:

xdebug.profiler_enable = 1

If you want to just enable it for certain requests you can use:

xdebug.profiler_enable_trigger_value

This will allow you to use ?XDEBUG_PROFILE=1 in your query string. However, if you are using mod_rewrite to rewrite your URLs in Apache, you need to make sure the rule has the [QSA] flag in it to pass the query string through or this will not work.

Output direcotry

You can set the output directory to whatever directory you wish using the output dir setting:

xdebug.profiler_output_dir = '/tmp/xdebug'

However, xdebug will not create this directory for you. You need to manually create the directory and give write permissions to the web server too.

Enable gzip compression in cPanel

Using gzip compression allows you to deliver website content faster as it can be gzipped on the server and uncompressed on the client, reducing the file size you need to transfer.

Unfortunately mod_deflate, the Apache module required to do this, is not enabled on all cPanel installs. However, if it is, or you have access to the server, you can easily enable it.

Enabling mod_deflate

If you do not have mod_deflate, you need to use EasyApache to add it. Log in to Web Host Manager and go to EasyApache (only server admins will be able to do this). Select build from the previous configuration and customise it until you get to the exhaustive options list.

Check the box next to mod_deflate and then re-build Apache.

Enabling compression

Once you have mod_deflate enabled, cPanel will have a new option. Under “software and services” in the x3 skin you fill find an option called “optimise website”. Click through to that page.

Compress content will probably be set to “disabled”.

Select “Compress the specified MIME types” instead. You could enable it for all content but I would not recommend this as some content you will not want to compress and much of it (images for example) is pretty pointless. The third option allows you to customise.

By default it should have the following options:

text/html text/plain text/xml

I recommend adding some more:

text/html text/plain text/xml text/css text/javascript

Hit “update settings” and you are done!

Symlink Git on cPanel

These days cPanel comes with Git. However, it is not available as a command by default but is instead hidden away in cPanel’s usual obscure location.

However, you can make it accessible using a symlink.

ln -s /usr/local/cpanel/3rdparty/bin/git /usr/local/bin/git

That will allow you to use the git command as normal. The version you get is likely to behind the current version of Git though.

MSVCR110.dll errors when running PHP

If you attempt to run php.exe on Windows you may get an error involving the following DLL.

MSVCR110.dll

The resolution to this is to install “Visual C++ Redistributable for Visual Studio 2012 Update 4”. Note that you should install the 32-bit version even if you are using a 64-bit operating system!

This can easily catch people out first time, however you can just install the 32-bit version over the top.

cPanel certificates expiring

If you use self-signed certificates on cPanel and WHM, they will still expire each year. You may find yourself getting an email such as:

The SSL certificate for ftp on host.example.com will expire in less than 30 days.

Your server’s SSL certificate for ftp will expire in less than 30 days. You need to install a new certificate as soon as possible. You can install a new certificate using WHM’s “Manage Service SSL Certificates” interface: https://host.example.com:2087/scripts2/manageservicecrts (Main >> Service Configuration >> Manage Service SSL Certificates).

To resolve this, click the link as suggested by the email. Then, next to each service, click “Reset Certificate”. This will generate a fresh certificate and automatically install it.

Resizing Coda’s file dialog on OS X Yosemite

Google Chrome is not the only application struggling with OS X Yosemite’s file dialog. When saving files in Coda, the dialog will continually fall off the bottom of the screen.

Currently the only known workaround for the issue is to switch to the simple view by clicking the up arrow next to the file name box, and then click it again to re-expand the dialog and then it will be probably sized again. However, you need to do this every time you save a file.