Web Development

Error starting ddev with custom dockerfile

Ran into a problem this morning where starting a ddev project resulted in this error:

2.677 Preparing to unpack .../libmcrypt-dev_2.5.8-7_amd64.deb ...
2.681 Unpacking libmcrypt-dev (2.5.8-7) ...
2.718 E: Sub-process /usr/bin/dpkg received a segmentation fault.
------
', stderr='Dockerfile:37

I searched for this error but only found a few results, one of the results suggested rebooting.

Tags: 

Block bots from search pages using Cloudflare

In the past several months many sites have seen massive traffic spikes from AI bots. This has lead to overloaded web servers, inflated web hosting costs, and negative effects for legitimate traffic.

Sites using a CDN can block some of this unwanted traffic relatively easy, once you know how.

Here's how I blocked bots using Cloudflare:

Tags: 

Fixing update_sql() to accept parameters

A pretty simple yet cool feature of Drupal's db_query() function is that you can pass in parameters that will make it automatically adjust the query to correctly escape the arguments. This is one of the simple security features in Drupal as it will properly escape the string to avoid SQL injection attacks, and just simply safe you hassle. Good stuff!

Tags: 

Managing Drupal Views, the proper way

One of the most powerful and most useful modules on Drupal is Views. With one screen you can build custom pages & blocks based around your content, select the exact fields you need, add filters and arguments, and relatively easily customize the display, and that's just scratching the surface. In fact, Views is so flexible that I've built sites which have 90% of their architecture based solely around taxonomies and Views.

Tags: 

Pages

Subscribe to Web Development