<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Meghna Meghwani</title>
    <description>The latest articles on DEV Community by Meghna Meghwani (@meghna_meghwani_).</description>
    <link>https://dev.to/meghna_meghwani_</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3600595%2F69d16c30-22ad-448f-a37b-1e106c145171.jpg</url>
      <title>DEV Community: Meghna Meghwani</title>
      <link>https://dev.to/meghna_meghwani_</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/meghna_meghwani_"/>
    <language>en</language>
    <item>
      <title>tar vs ZIP in Linux: Which Compression Format Should You Use?</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Wed, 09 Sep 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/serveravatar/tar-vs-zip-in-linux-which-compression-format-should-you-use-1p10</link>
      <guid>https://dev.to/serveravatar/tar-vs-zip-in-linux-which-compression-format-should-you-use-1p10</guid>
      <description>&lt;p&gt;If you have ever downloaded a Linux backup ending in .tar.gz and wondered why it was not simply a .zip, you are not alone. The tar vs ZIP comparison matters because both formats can bundle a directory into one convenient file, reduce storage use, and are easy to extract. That makes the choice look less important than it really is.&lt;/p&gt;

&lt;p&gt;The practical difference appears when the archive contains Linux permissions, symbolic links, many small files, or data that needs to move to Windows or macOS. Pick the wrong format and the archive may still open, but it may not restore exactly the way you expected.&lt;/p&gt;

&lt;p&gt;I compared tar vs ZIP in Linux with a small reproducible test instead of relying only on feature lists. In this guide, I will explain what each tool actually does, show the commands I use, share the test results, and give you a direct recommendation for backups, file transfers, website files, and cross-platform sharing.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use .tar.gz for Linux server backups, application directories, deployment packages, permissions, and symbolic links.&lt;/li&gt;
&lt;li&gt;Use .zip when the archive will be opened by people on Windows, macOS, and Linux, especially for ordinary documents or media.&lt;/li&gt;
&lt;li&gt;A plain .tar file is an archive, not a compressed archive. Add gzip (.tar.gz) when you also want compression.&lt;/li&gt;
&lt;li&gt;ZIP compresses files individually. Tar usually combines the files first, and gzip compresses the combined stream.&lt;/li&gt;
&lt;li&gt;Neither format replaces a proper backup plan. Always test extraction and keep copies away from the source server.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  TAR.GZ vs ZIP: Choosing the Right Format
&lt;/h2&gt;

&lt;p&gt;For day-to-day Linux server work, .tar.gz is my default. It fits the way Linux stores directory structures and metadata, it handles symbolic links properly, and it is available on practically every Linux server I work with.&lt;/p&gt;

&lt;p&gt;ZIP is still the better choice in one common situation: I am sending files to someone who should be able to open them without thinking about Linux tools. A ZIP attachment containing PDFs, images, or exported reports is easy for almost anyone to use.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here is the decision in one table:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq4tfl5zb2q4idz1vcjof.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fq4tfl5zb2q4idz1vcjof.png" alt="decision_table" width="800" height="468"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My rule is simple:&lt;/strong&gt; if the archive will return to a Linux server, I use tar. If it is mainly for people to download and open on different desktop systems, I use ZIP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/tar-vs-zip" rel="noopener noreferrer"&gt;https://serveravatar.com/tar-vs-zip&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>webdev</category>
      <category>techtalks</category>
    </item>
    <item>
      <title>How to Reduce Cache Misses and Improve Application Performance</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Tue, 08 Sep 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-reduce-cache-misses-and-improve-application-performance-1jg8</link>
      <guid>https://dev.to/serveravatar/how-to-reduce-cache-misses-and-improve-application-performance-1jg8</guid>
      <description>&lt;p&gt;A cache is supposed to remove work. Yet an application can have Redis installed, a CDN enabled, and a page-cache plugin active while still rebuilding the same responses again and again. To reduce cache misses, you must ensure the application can consistently reuse cached data. The problem usually isn’t a missing cache, it’s a cache that the application can’t reuse effectively.&lt;/p&gt;

&lt;p&gt;Learning how to reduce cache misses starts with finding out why a lookup failed. A short lifetime, an unstable key, an undersized memory limit, and an intentional bypass can all increase the miss counter, but they require very different fixes. Increasing memory won’t repair a key that changes on every request. A longer TTL won’t help when authenticated traffic bypasses the page cache by design.&lt;/p&gt;

&lt;p&gt;This guide is for developers, WordPress administrators, and teams running PHP, Laravel, or Node.js applications on a VPS. You’ll learn how to read the right metrics, classify misses, improve cache reuse safely, and verify that the changes reduce real response time rather than merely producing a prettier hit-rate percentage.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Measure hit rate, misses, evictions, latency, memory, and origin work together.&lt;/li&gt;
&lt;li&gt;Separate expected cold or bypassed requests from avoidable misses before tuning anything.&lt;/li&gt;
&lt;li&gt;Normalize cache keys so equivalent requests map to the same entry.&lt;/li&gt;
&lt;li&gt;Assign TTLs according to the cost and volatility of each data type, not one global number.&lt;/li&gt;
&lt;li&gt;Prevent cache stampedes with request coalescing, locks, early refresh, or stale-while-revalidate.&lt;/li&gt;
&lt;li&gt;Invalidate the smallest affected cache area after a write; avoid routine full-cache flushes.&lt;/li&gt;
&lt;li&gt;Confirm improvements with p95 response time, database load, and field Core Web Vitals.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why a Cache Miss Is Only the Beginning
&lt;/h2&gt;

&lt;p&gt;A cache hit occurs when the requested value is present, valid, and reusable. A miss means the application has to obtain or compute that value elsewhere. The fallback might be a database query, an API call, a rendered HTML page, or an expensive calculation.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1o4cr8b337a2e1t7ztr2.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1o4cr8b337a2e1t7ztr2.jpg" alt="reduce cache misses" width="800" height="596"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The basic hit-rate formula is:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Cache hit rate = hits / (hits + misses) × 100
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If a cache records 72,000 hits and 18,000 misses, its hit rate is 80%. That number is useful, but it isn’t a verdict. A cache protecting a slow third-party API may deliver major savings at 80%, while an edge cache for versioned CSS files should normally reuse far more requests. Context matters.&lt;/p&gt;

&lt;p&gt;You also need to distinguish the layer being measured. Browser cache, CDN cache, NGINX page cache, PHP OPcache, Redis object cache, and an application-level memoization cache do different jobs. Combining their counters into one ratio hides the bottleneck.&lt;/p&gt;

&lt;p&gt;The practical question is not “How do I make the hit rate 100%?” It is: Which expensive operations are repeated, and why can’t the existing cache answer them?&lt;/p&gt;

&lt;p&gt;That framing prevents two common mistakes: caching data that should remain dynamic and optimizing cheap lookups while a slow database query remains untouched.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/reduce-cache-misses-application-performance" rel="noopener noreferrer"&gt;https://serveravatar.com/reduce-cache-misses-application-performance&lt;/a&gt;&lt;/p&gt;

</description>
      <category>performance</category>
      <category>webdev</category>
      <category>devops</category>
      <category>caching</category>
    </item>
    <item>
      <title>How to Send Emails From WordPress Using Gmail SMTP for Free</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Mon, 07 Sep 2026 07:44:45 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-send-emails-from-wordpress-using-gmail-smtp-for-free-494b</link>
      <guid>https://dev.to/serveravatar/how-to-send-emails-from-wordpress-using-gmail-smtp-for-free-494b</guid>
      <description>&lt;p&gt;WordPress may show a reassuring “message sent” notice even when no email reaches the recipient. That gap is frustrating when the missing message is a password reset, contact-form notification, new-account email, or order receipt. WordPress Gmail SMTP provides a reliable way to send emails through Email’s SMTP server instead of relying on your web host’s default mail function.&lt;/p&gt;

&lt;p&gt;You can send emails from WordPress using Gmail SMTP without paying for a separate email service. The setup in this guide uses FluentSMTP, a free WordPress plugin, and a Google App Password. It is suitable for personal sites, portfolios, staging sites, and small websites that send a modest number of transactional messages.&lt;/p&gt;

&lt;p&gt;This isn’t a newsletter solution, and it won’t guarantee inbox placement. What it will do is replace the server’s often-unreliable default mail path with an authenticated connection to Gmail. You’ll learn how to decide whether Gmail is appropriate, prepare the account safely, configure WordPress, verify more than a green success message, and diagnose the failures that usually trip people up.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Install the free FluentSMTP plugin and select Other SMTP.&lt;/li&gt;
&lt;li&gt;Use smtp.gmail.com, TLS encryption, and port 587.&lt;/li&gt;
&lt;li&gt;Turn on Google 2-Step Verification and create a dedicated App Password.&lt;/li&gt;
&lt;li&gt;Keep the WordPress From Email identical to the Gmail account used for authentication.&lt;/li&gt;
&lt;li&gt;Send a test, inspect the email log, and check the received message headers.&lt;/li&gt;
&lt;li&gt;Use Gmail only for low-volume transactional messages, not newsletters or bulk campaigns.&lt;/li&gt;
&lt;li&gt;Prefer OAuth when your chosen plugin offers a practical Gmail integration; Google recommends it over App Passwords.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  First, Understand What This Setup Changes
&lt;/h2&gt;

&lt;p&gt;WordPress applications commonly call the &lt;a href="https://developer.wordpress.org/reference/functions/wp_mail?ref=serveravatar.com" rel="noopener noreferrer"&gt;wp_mail() function&lt;/a&gt; when they need to send a message. By itself, wp_mail() is only an interface. It passes the message to the configured mailer; it does not provide a reputation system or an email-delivery network.&lt;/p&gt;

&lt;p&gt;On many VPSs, WordPress hands mail to PHP’s local mail function. That route can fail because the server has no mail transfer agent, outbound SMTP ports are restricted, the sending IP has a poor reputation, or the message lacks authentication that receiving providers expect.&lt;/p&gt;

&lt;p&gt;An SMTP plugin changes the transport. Instead of asking the web server to deliver the message directly, WordPress authenticates with Gmail and asks Google to send it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmiukre3dd5pwd85u4nmu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmiukre3dd5pwd85u4nmu.png" alt="Component_table" width="799" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This distinction matters during troubleshooting. A successful plugin log means Gmail accepted the submission. It does not prove that the recipient’s provider placed the message in the inbox.&lt;/p&gt;

&lt;p&gt;Email reliability is only one part of WordPress performance; if your site also has slow server response times, see our &lt;a href="https://serveravatar.com/wordpress-ttfb-optimization" rel="noopener noreferrer"&gt;WordPress TTFB optimization guide&lt;/a&gt;. &lt;/p&gt;

&lt;h2&gt;
  
  
  Is Free Gmail SMTP the Right Choice for Your WordPress Site?
&lt;/h2&gt;

&lt;p&gt;Gmail SMTP is useful when the site sends occasional operational emails. Think of a portfolio contact form, a small membership site, an internal staging environment, or a low-traffic blog where password resets are the main concern.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;It is a poor fit for:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Marketing newsletters&lt;/li&gt;
&lt;li&gt;Large membership communities&lt;/li&gt;
&lt;li&gt;Busy WooCommerce stores&lt;/li&gt;
&lt;li&gt;Applications with bursts of notifications&lt;/li&gt;
&lt;li&gt;Sites that need delivery analytics, bounce processing, suppression lists, or guaranteed support&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Google enforces sending and recipient limits, and the thresholds vary by account type and sending method. See Google’s &lt;a href="https://support.google.com/mail/answer/22839?ref=serveravatar.com" rel="noopener noreferrer"&gt;Gmail sending limits&lt;/a&gt; for the current restrictions.  Google’s consumer help page warns that sending may be suspended temporarily when limits are reached, while Google Workspace publishes separate limits for paid organizational accounts. Treat those limits as ceilings, not daily targets. They can change, and anti-abuse systems can restrict suspicious sending before a published maximum is reached.&lt;/p&gt;

&lt;p&gt;If your site sends only a few dozen transactional messages on a normal day, Gmail can be a sensible free starting point. If email is tied directly to revenue or customer access, use a transactional provider designed for application mail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/wordpress-gmail-smtp" rel="noopener noreferrer"&gt;https://serveravatar.com/wordpress-gmail-smtp&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>smtp</category>
      <category>webdev</category>
      <category>devops</category>
    </item>
    <item>
      <title>How to Fix “Cannot Use Import Statement Outside a Module” in JavaScript</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Thu, 03 Sep 2026 08:46:20 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-fix-cannot-use-import-statement-outside-a-module-in-javascript-33hk</link>
      <guid>https://dev.to/serveravatar/how-to-fix-cannot-use-import-statement-outside-a-module-in-javascript-33hk</guid>
      <description>&lt;p&gt;You run a JavaScript file that looks perfectly valid, yet the process stops before the first useful line executes: Cannot Use Import Statement Outside a Module.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SyntaxError: Cannot use import statement outside a module
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The wording makes the import statement look guilty. Usually, it isn’t. The real problem is that your runtime and your source file disagree about the file’s module format.&lt;/p&gt;

&lt;p&gt;This guide shows you how to identify that disagreement before changing project settings. You’ll learn how to fix the error in Node.js, a browser, TypeScript, and common development tools without creating a second module problem elsewhere. It is written for developers who want a reliable diagnosis, not a list of unrelated commands to try.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;First identify which program is executing the file: Node.js, a browser, a test runner, or a TypeScript tool.&lt;/li&gt;
&lt;li&gt;In Node.js, choose one module system for the relevant package: ESM with &lt;code&gt;"type": "module"&lt;/code&gt; or &lt;code&gt;.mjs&lt;/code&gt;, or CommonJS with &lt;code&gt;require()&lt;/code&gt; and &lt;code&gt;.cjs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;In a browser, load an entry file with &lt;code&gt;&amp;lt;script type="module"&amp;gt;&lt;/code&gt; and use valid browser-resolvable import paths.&lt;/li&gt;
&lt;li&gt;In TypeScript, align &lt;code&gt;package.json&lt;/code&gt;, &lt;code&gt;tsconfig.json&lt;/code&gt;, the emitted JavaScript, and the command that launches it.&lt;/li&gt;
&lt;li&gt;Don't add Babel or another build tool until you know the current runtime cannot execute the format you intend to use.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What the Error Is Actually Telling You
&lt;/h2&gt;

&lt;p&gt;In Node.js projects, developers commonly encounter two module systems: ECMAScript modules (ESM) and CommonJS (CJS).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you're getting started with Node.js or deciding whether it fits your application, see our guide to the &lt;a href="https://serveravatar.com/key-reasons-to-choose-nodejs-for-web-development/" rel="noopener noreferrer"&gt;key reasons Node.js is a strong choice for web development in 2026&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmfy6yeznsctgkimh9ffr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmfy6yeznsctgkimh9ffr.png" alt="table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Static &lt;code&gt;import&lt;/code&gt; declarations belong to ESM. If the runtime parses the same file as a classic script or a CommonJS module, it rejects the syntax before your application starts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbi0n9rdrtq7qyp466ixv.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fbi0n9rdrtq7qyp466ixv.jpg" alt="module_format"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;That detail matters because this is a parsing and configuration error, not normally a package-installation error. Reinstalling &lt;code&gt;node_modules&lt;/code&gt; may change nothing. The useful question is:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Why did this specific runtime classify this specific file as something other than an ES module?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Node.js uses explicit markers such as file extensions and the nearest parent &lt;code&gt;package.json&lt;/code&gt; to determine a file's format. A browser uses the script element and the module graph. Test runners and transpilers may apply another transformation layer before either one sees the code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8q562bzdb3l2enfvic2b.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F8q562bzdb3l2enfvic2b.jpg" alt="difference_parser"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For the complete rules Node.js uses to determine whether a file is treated as ESM or CommonJS, see the &lt;a href="https://nodejs.org/api/packages.html?ref=serveravatar.com" rel="noopener noreferrer"&gt;Node.js documentation on packages and module formats&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Read the full article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/fix-cannot-use-import-statement-outside-module" rel="noopener noreferrer"&gt;https://serveravatar.com/fix-cannot-use-import-statement-outside-module&lt;/a&gt;&lt;/p&gt;

</description>
      <category>javascript</category>
      <category>webdev</category>
      <category>node</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Use git reset to Revert to Previous Commit in Git</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Sat, 29 Aug 2026 07:38:52 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-use-git-reset-to-revert-to-previous-commit-in-git-3igm</link>
      <guid>https://dev.to/serveravatar/how-to-use-git-reset-to-revert-to-previous-commit-in-git-3igm</guid>
      <description>&lt;p&gt;Have you committed too early, included the wrong files, or taken a local branch in a direction you no longer want? Git Reset to Previous Commit lets you move that branch back to an earlier commit using git reset. The difficult part isn’t typing the command. It’s choosing what should happen to the changes that came after the target commit.&lt;/p&gt;

&lt;p&gt;This guide shows how to use git reset to revert to a previous commit while protecting the work you may still need. It is written for developers who are comfortable running basic Git commands but want a safer way to undo local commits. You’ll learn how Git’s three reset modes behave, practice them in a disposable repository, handle common scenarios, and recover when a reset goes farther than intended.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Quick safety rule:&lt;/strong&gt; If the commits are already on a shared remote branch, pause before using git reset. In most team workflows, git revert is the safer choice because it preserves the published history.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Use git reset --soft HEAD~1 to remove the latest commit while keeping its changes staged.&lt;/li&gt;
&lt;li&gt;Use git reset HEAD~1 to remove the latest commit while keeping its changes unstaged. This is the default --mixed behavior.&lt;/li&gt;
&lt;li&gt;Use git reset --hard HEAD~1 only when you intentionally want to discard tracked changes as well as commits.&lt;/li&gt;
&lt;li&gt;Inspect git status, git log, and git diff before and after resetting.&lt;/li&gt;
&lt;li&gt;Prefer git revert for commits that teammates may already have pulled.&lt;/li&gt;
&lt;li&gt;If you reset to the wrong place, use git reflog to locate the earlier branch position.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Before You Reset: Decide Whether History May Be Rewritten
&lt;/h2&gt;

&lt;p&gt;The key question to ask first is not, “Which reset mode is right for me?” It is “Does anyone else depend on this branch history?”&lt;/p&gt;

&lt;p&gt;git reset changes where the current branch points. A commit can disappear from the visible path of that branch even though Git may retain the underlying object for some time.&lt;/p&gt;

&lt;p&gt;That is convenient on a private feature branch. On a shared branch such as main, however, rewriting the published sequence can leave another developer’s local history out of sync.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Use this decision table before running anything:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwa6dilct6rusp7qcatet.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fwa6dilct6rusp7qcatet.png" alt="decision table" width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Git’s official documentation separates these jobs clearly: git reset moves a branch or updates the index, while git revert records a new commit that reverses an earlier commit.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;If your team deploys from Git, history changes can also affect the commit a server expects to fetch. Review the deployment pipeline before rewriting any branch used in production.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fju15czoljspobn1go50d.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fju15czoljspobn1go50d.jpg" alt="Git Reset to Previous Commit" width="764" height="336"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Understand What git reset Actually Changes
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;A Git project has three working layers that matter during a reset:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;HEAD and the current branch:&lt;/strong&gt; HEAD normally refers to the branch you have checked out, and that branch points to a commit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The index:&lt;/strong&gt; Also called the staging area, it stores the snapshot prepared for the next commit.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The working tree:&lt;/strong&gt; These are the files you can currently open and edit.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When you run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git reset &amp;lt;target-commit&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Git moves the current branch to . The mode determines whether Git also changes the index and working tree.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frtvyx3oudwjabthd7gdv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Frtvyx3oudwjabthd7gdv.png" alt="difference table" width="799" height="393"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If no mode is supplied, Git uses --mixed.&lt;/p&gt;

&lt;p&gt;Two details prevent common surprises:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;--hard can overwrite modifications to tracked files. Commit, stash, or back up anything you may need first.&lt;/li&gt;
&lt;li&gt;A hard reset does not generally remove ordinary untracked files. Removing untracked files is a separate operation, commonly handled with git clean, which is outside the reset itself.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are additional options such as --merge and --keep, but they solve narrower cases involving local changes and merge-like resets.&lt;/p&gt;

&lt;p&gt;For the everyday task of returning a private branch to an earlier commit, soft, mixed, and hard are the modes worth understanding first.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/git-reset" rel="noopener noreferrer"&gt;https://serveravatar.com/git-reset&lt;/a&gt;&lt;/p&gt;

</description>
      <category>git</category>
      <category>github</category>
      <category>devops</category>
      <category>programming</category>
    </item>
    <item>
      <title>How to Fix Error Establishing a Database Connection in WordPress</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Thu, 27 Aug 2026 06:42:13 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-fix-error-establishing-a-database-connection-in-wordpress-553k</link>
      <guid>https://dev.to/serveravatar/how-to-fix-error-establishing-a-database-connection-in-wordpress-553k</guid>
      <description>&lt;p&gt;You’re working on your WordPress site. Everything looks fine one minute, and the next, a stark white page with a single line of text stares back at you: “Error Establishing a Database Connection”. This WordPress database connection error means your posts, pages, comments, user data, all of it lives inside that database. And WordPress is telling you it can’t reach it anymore.&lt;/p&gt;

&lt;p&gt;I’ve been there. More importantly, I’ve fixed this error on dozens of sites, my own, client projects, and staging environments that somehow got into a bad state overnight. The good news is this: it’s almost always solvable, and it usually doesn’t take long.&lt;/p&gt;

&lt;p&gt;This guide walks you through every real cause of this error and every real fix, ordered from the most common to the least common. I will explain what’s actually happening at each step, not just what to type, because understanding the “why” is what makes you faster the next time this happens.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;p&gt;Here’s the quick version before you dive in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Most common cause: Wrong database credentials in wp-config.php&lt;/li&gt;
&lt;li&gt;Second most common: Corrupted database tables from failed updates or plugin conflicts&lt;/li&gt;
&lt;li&gt;Quickest test: Add WP_ALLOW_REPAIR to wp-config.php and visit the repair page&lt;/li&gt;
&lt;li&gt;Always back up first, before touching anything&lt;/li&gt;
&lt;li&gt;If multiple sites are down at once, it’s server issue, not a WordPress issue&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Triggers This Error?
&lt;/h2&gt;

&lt;p&gt;Before reaching for fixes, it helps to understand the architecture. WordPress is a PHP application. Every time a visitor lands on your site, PHP code runs, asks your MySQL database for the content, and assembles a page to send back.&lt;/p&gt;

&lt;p&gt;When that handshake breaks, you get the error. Here’s what typically causes it:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Incorrect Database Credentials&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;WordPress stores four critical pieces of information in your wp-config.php file, the database name, the username, the password, and the hostname. If any one of those is wrong, the connection gets refused. This is the single most common cause, responsible for the majority of cases I see.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Corrupted Database Tables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Over time, database tables can become corrupted, especially after a plugin fails mid-update, a theme install gets interrupted, or the server loses power at the wrong moment. When the table structure breaks, WordPress can’t read the data it needs, even if the credentials are perfect.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Database User Loses Permissions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A database user can exist with the right password but without the right privileges. MySQL permissions are managed separately from login credentials. If something strips those permissions, a bad migration script, a one-click “optimization” tool, or a hosting control panel glitch, WordPress gets locked out despite having correct-looking credentials.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. The MySQL Server Itself Is Unresponsive&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sometimes the problem isn’t WordPress or your config, it’s that the MySQL service has stopped, run out of memory, or is being overwhelmed. This is a server-level problem, and it requires server-level attention.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Sudden Traffic Spikes Overwhelming the Database&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;A single plugin that goes viral on Hacker News, a social media mention from an influencer, these can flood your server with simultaneous connection requests. MySQL has a limit on concurrent connections, and when that limit fills up, new requests get refused.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Corrupted WordPress Core Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This is rarer, but if a core WordPress file that handles database communication gets damaged, from a failed auto-update, for example, it can produce this exact error even when everything else is fine.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step: How to Fix the Error
&lt;/h2&gt;

&lt;p&gt;Follow these steps in order. Each one eliminates a common cause. If step one doesn’t solve it, move to step two. By the time you reach step seven, you’ll have ruled out almost everything.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Create a Backup Before Making Changes
&lt;/h3&gt;

&lt;p&gt;Before troubleshooting database problems, create a backup of your website. Ideally, your backup should include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;WordPress files&lt;/li&gt;
&lt;li&gt;WordPress database&lt;/li&gt;
&lt;li&gt;Important configuration files&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This gives you a recovery point if a repair operation or configuration change causes another problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating a Backup with ServerAvatar&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your WordPress website is managed through &lt;a href="https://serveravatar.com" rel="noopener noreferrer"&gt;ServerAvatar&lt;/a&gt;, you can &lt;a href="https://serveravatar.com/website-backup" rel="noopener noreferrer"&gt;create website backup&lt;/a&gt; directly from the ServerAvatar dashboard.&lt;/p&gt;

&lt;p&gt;ServerAvatar supports application backups that include the application’s files and associated database. It also provides options for storing backups to ServerAvatar storage or to your own cloud-storage provider from available options.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Important:&lt;/strong&gt; Do not assume that a backup exists simply because backups were configured previously. Check that recent backups are actually available before proceeding.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Verify Your Database Credentials in wp-config.php
&lt;/h3&gt;

&lt;p&gt;This is one of the first things you should check. The wp-config.php file is normally located in the root directory of your WordPress installation.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Look for:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/** The name of the database for WordPress */
define( 'DB_NAME', 'your_database_name' );

/** MySQL database username */
define( 'DB_USER', 'your_username' );

/** MySQL database password */
define( 'DB_PASSWORD', 'your_password' );

/** MySQL hostname */
define( 'DB_HOST', 'localhost' );
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For more information about the config file and its database-related settings, see the official &lt;a href="https://developer.wordpress.org/advanced-administration/wordpress/wp-config?ref=serveravatar.com" rel="noopener noreferrer"&gt;WordPress wp-config.php documentation&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Managing Database Details with ServerAvatar&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;If your server is managed through ServerAvatar, you can manage databases and database users through the ServerAvatar dashboard instead of relying entirely on command-line database administration.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to your server panel by clicking on the server dashboard icon.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3tn1b811lsqms5955ueb.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F3tn1b811lsqms5955ueb.jpg" alt="navigate to the server panel - WordPress database connection error" width="800" height="171"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the Application section, and click on your WordPress application dashboard icon.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmz86p1b0uqlc80s86udg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fmz86p1b0uqlc80s86udg.jpg" alt="navigate to the application panel - WordPress database connection error" width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the File Manager section from the left sidebar, and navigate to the public_html folder.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuuvnv6t7hghfo636bivn.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fuuvnv6t7hghfo636bivn.jpg" alt="edit wp config from file manager - WordPress database connection error" width="800" height="366"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the wp-config.php file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F62ofptxtkoigfvo458fz.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F62ofptxtkoigfvo458fz.jpg" alt="check and verify the details - WordPress database connection error" width="800" height="386"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check each mentioned value carefully:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;DB_NAME :&lt;/strong&gt; Make sure the database exists and that the name matches the database assigned to your WordPress installation.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DB_USER :&lt;/strong&gt; Confirm that the database user exists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DB_PASSWORD :&lt;/strong&gt; Make sure the password matches the password configured for that database user.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DB_HOST :&lt;/strong&gt; localhost is common when the database is running on the same server, but the correct value depends on your server architecture.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Do not automatically replace DB_HOST with localhost unless you know that the database is running locally.&lt;/p&gt;

&lt;p&gt;After confirming the correct credentials, make sure the values in wp-config.php match your database configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/wordpress-database-connection-error" rel="noopener noreferrer"&gt;https://serveravatar.com/wordpress-database-connection-error&lt;/a&gt;&lt;/p&gt;

</description>
      <category>wordpress</category>
      <category>database</category>
      <category>php</category>
      <category>webdev</category>
    </item>
    <item>
      <title>How to Secure PHP Web Application: Best Security Practices</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Wed, 26 Aug 2026 07:41:15 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-secure-php-web-application-best-security-practices-8ik</link>
      <guid>https://dev.to/serveravatar/how-to-secure-php-web-application-best-security-practices-8ik</guid>
      <description>&lt;p&gt;PHP remains one of the most widely used server-side technologies, powering around 70% of websites whose server-side programming language is known. That dominance also makes it a prime target. Every day, thousands of automated bots scan the web looking for vulnerable PHP applications, unpatched versions, insecure configurations, sloppy input handling. If you’re building or managing a PHP app today, learning how to secure PHP web application is essential to protect your application from potential security threats.&lt;/p&gt;

&lt;p&gt;This isn’t a scare tactic. It’s the reality of deploying software on the internet in 2026. The good news: PHP has matured significantly, and modern PHP (8.x) offers security primitives that match any other server-side language. The bad news: security still depends almost entirely on how you write, configure, and maintain your code. Language-level protections only go so far.&lt;/p&gt;

&lt;p&gt;This guide covers the essential layers of PHP application security, from php.ini hardening to SAST tooling, from SQL injection prevention to Content Security Policy headers. Whether you’re running a Laravel app, a WordPress site, or a custom PHP project, these practices apply.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0m7qiyj6dnxwphsiqc9q.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F0m7qiyj6dnxwphsiqc9q.jpg" alt="Flow for Secure PHP Web Application" width="584" height="467"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Lock down php.ini before deploying, disable dangerous functions, hide PHP version headers, restrict file uploads&lt;/li&gt;
&lt;li&gt;Use PDO prepared statements for every database query, no exceptions&lt;/li&gt;
&lt;li&gt;Escape every variable at output time with context-aware encoding, htmlspecialchars() for HTML, json_encode() for JavaScript&lt;/li&gt;
&lt;li&gt;Use CSP headers (Content Security Policy) to add an XSS defense layer beyond output encoding&lt;/li&gt;
&lt;li&gt;Hash passwords with PASSWORD_ARGON2ID or PASSWORD_BCRYPT , never MD5 or SHA1, ever&lt;/li&gt;
&lt;li&gt;Harden PHP sessions: HttpOnly, Secure, SameSite=Lax, strict mode, and session ID regeneration on login&lt;/li&gt;
&lt;li&gt;Add CSRF tokens to every state-changing form using hash_equals() for timing-safe comparison&lt;/li&gt;
&lt;li&gt;Run composer audit in CI on every push, dependency vulnerabilities are low-effort attack vectors&lt;/li&gt;
&lt;li&gt;Integrate SAST tools (Psalm, PHPStan) into your development workflow to catch security issues before they reach production&lt;/li&gt;
&lt;li&gt;Set HTTP security headers on every response: X-Frame-Options, X-Content-Type-Options, Strict-Transport-Security, and Permissions-Policy&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why PHP Security Still Matters
&lt;/h2&gt;

&lt;p&gt;PHP has changed considerably over the years. Many security problems associated with older PHP releases came from outdated features, weak defaults, poor development practices, or obsolete libraries.&lt;/p&gt;

&lt;p&gt;Modern PHP applications can be highly secure when they are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Properly configured&lt;/li&gt;
&lt;li&gt;Regularly updated&lt;/li&gt;
&lt;li&gt;Developed using secure coding practices&lt;/li&gt;
&lt;li&gt;Protected by multiple security layers&lt;/li&gt;
&lt;li&gt;Continuously monitored for vulnerabilities&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The bigger challenge is PHP’s enormous ecosystem. Attackers can automatically search the internet for applications containing:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Outdated WordPress components&lt;/li&gt;
&lt;li&gt;Vulnerable Composer dependencies&lt;/li&gt;
&lt;li&gt;Exposed .env files&lt;/li&gt;
&lt;li&gt;Debug mode enabled in production&lt;/li&gt;
&lt;li&gt;Weak authentication&lt;/li&gt;
&lt;li&gt;Unsafe file upload functionality&lt;/li&gt;
&lt;li&gt;Poorly validated input&lt;/li&gt;
&lt;li&gt;Known vulnerable PHP versions&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Security Is Also a Business Issue
&lt;/h3&gt;

&lt;p&gt;A compromised application can cause more than technical problems. A successful attack may result in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Customer data exposure&lt;/li&gt;
&lt;li&gt;Account takeovers&lt;/li&gt;
&lt;li&gt;Website defacement&lt;/li&gt;
&lt;li&gt;Malware distribution&lt;/li&gt;
&lt;li&gt;Search engine reputation problems&lt;/li&gt;
&lt;li&gt;Loss of customer trust&lt;/li&gt;
&lt;li&gt;Downtime&lt;/li&gt;
&lt;li&gt;Regulatory or compliance problems&lt;/li&gt;
&lt;li&gt;Financial losses&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The goal isn’t to make an application completely immune to attacks. Instead, build multiple security layers so that a single mistake doesn’t automatically become a successful compromise.&lt;/p&gt;

&lt;p&gt;Let’s get into the actual hardening steps.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/secure-php-application" rel="noopener noreferrer"&gt;https://serveravatar.com/secure-php-application&lt;/a&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>security</category>
      <category>webdev</category>
      <category>cybersecurity</category>
    </item>
    <item>
      <title>GitHub Explained: What It Is, How It Works, and How to Use It</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Mon, 24 Aug 2026 07:28:56 +0000</pubDate>
      <link>https://dev.to/serveravatar/github-explained-what-it-is-how-it-works-and-how-to-use-it-3kc7</link>
      <guid>https://dev.to/serveravatar/github-explained-what-it-is-how-it-works-and-how-to-use-it-3kc7</guid>
      <description>&lt;p&gt;If you’ve ever joined a development team and felt lost when someone said “push to main,” “open a pull request,” or “what branch are you on,” you’re not alone. GitHub is one of those tools that developers take for granted, they assume everyone knows it, but the reality is that most newcomers stumble through it at first.&lt;/p&gt;

&lt;p&gt;This guide is for those people: anyone who wants to understand what GitHub actually is, why it matters, and how to put it to work when deploying web applications through a platform like ServerAvatar.&lt;/p&gt;

&lt;p&gt;We will cover everything from the raw concept of version control to actually connecting your GitHub account to ServerAvatar and getting your code live on a server without touching a command line. No prior experience needed.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Git is a distributed version control system that tracks every change made to your project files&lt;/li&gt;
&lt;li&gt;GitHub is a cloud platform that hosts Git repositories and makes collaboration practical&lt;/li&gt;
&lt;li&gt;Branching lets you work on features in isolation; merging combines those changes back in&lt;/li&gt;
&lt;li&gt;Pull requests create a formal review process before code is merged&lt;/li&gt;
&lt;li&gt;ServerAvatar connects directly to GitHub and can clone, deploy, and auto-update your PHP and Node.js applications&lt;/li&gt;
&lt;li&gt;For private repos, you’ll add an SSH key to GitHub; for public repos, a simple HTTPS URL works&lt;/li&gt;
&lt;li&gt;Webhooks let GitHub notify ServerAvatar automatically whenever you push new code&lt;/li&gt;
&lt;li&gt;Deployment scripts let you run framework commands (cache clears, migrations, builds) after every pull&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Before understanding GitHub, it helps to understand Git itself.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is Git?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://git-scm.com/?ref=serveravatar.com" rel="noopener noreferrer"&gt;Git&lt;/a&gt; is a distributed version control platform introduced by Linus Torvalds in 2005 to help developers efficiently manage and track changes in their code. It records changes made to a project’s files, allowing developers to track, compare, restore, and collaborate on different versions of their code.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzerz6owrep9adj03r4yg.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fzerz6owrep9adj03r4yg.jpg" alt="GIt - GitHub" width="800" height="375"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What Git Does
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Tracks code changes:&lt;/strong&gt; Records what was added, modified, or removed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Maintains project history:&lt;/strong&gt; Keeps a detailed record of previous versions and commits.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Creates restore points:&lt;/strong&gt; Lets you return to an earlier working version when something breaks.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports experimentation:&lt;/strong&gt; Developers can work on new features without changing the stable version of the project.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Works offline:&lt;/strong&gt; Git runs locally, so you can commit and manage changes without an internet connection.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Supports collaboration:&lt;/strong&gt; Multiple developers can work on the same codebase and combine their changes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Keeps a complete project copy:&lt;/strong&gt; Every Git clone contains the repository’s files and history, reducing dependency on a single server.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Git Is Distributed
&lt;/h3&gt;

&lt;p&gt;Git is called a distributed version control system because every developer who clones a repository gets a local copy of the project and its history.&lt;/p&gt;

&lt;p&gt;This means developers can:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create commits without an internet connection.&lt;/li&gt;
&lt;li&gt;Review previous commits locally.&lt;/li&gt;
&lt;li&gt;Create and switch between branches.&lt;/li&gt;
&lt;li&gt;Compare changes.&lt;/li&gt;
&lt;li&gt;Continue working even when a remote Git server is unavailable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Once an internet connection is available, local changes can be pushed to a remote repository such as GitHub.&lt;/p&gt;

&lt;h3&gt;
  
  
  Git Is Not GitHub
&lt;/h3&gt;

&lt;p&gt;Git and GitHub are closely related, but they are different:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Git&lt;/strong&gt; is the version control software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;GitHub&lt;/strong&gt; is an online platform that hosts Git repositories and provides collaboration tools.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can use Git without GitHub. GitHub simply makes it easier to store Git repositories remotely and work with other developers.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If Git isn’t installed on your Ubuntu system yet, follow our guide on &lt;a href="https://serveravatar.com/install-git-ubuntu/" rel="noopener noreferrer"&gt;how to install Git on Ubuntu&lt;/a&gt; before using Git commands locally.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What Is GitHub?
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/?ref=serveravatar.com" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; is a web-based platform for hosting Git repositories and collaborating on software projects. It combines Git’s version control capabilities with tools for code review, project management, automation, and team collaboration.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiz3e2u42fgdvstaru9kk.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiz3e2u42fgdvstaru9kk.jpg" alt="GitHub" width="800" height="349"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/what-is-github" rel="noopener noreferrer"&gt;https://serveravatar.com/what-is-github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>git</category>
      <category>webdev</category>
      <category>beginners</category>
    </item>
    <item>
      <title>How to Fix HTTP 503 Service Unavailable Error (Complete 2026 Guide)</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Sat, 22 Aug 2026 07:00:00 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-fix-http-503-service-unavailable-error-complete-2026-guide-mf3</link>
      <guid>https://dev.to/serveravatar/how-to-fix-http-503-service-unavailable-error-complete-2026-guide-mf3</guid>
      <description>&lt;p&gt;You refresh your website. Instead of loading, you get a blank white page with four words: HTTP 503 Service Unavailable Error. No explanation. No timeline. No next step. Whether you’re managing a WordPress site, an eCommerce store, or a web application, the HTTP 503 Service Unavailable Error can instantly make your website inaccessible to visitors and impact your business.&lt;/p&gt;

&lt;p&gt;I’ve been there. Not just as a user, but as someone responsible for the server when that message started appearing for hundreds of real visitors. The 503 error is frustrating because it tells you something is wrong but gives you almost nothing to work with.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Here’s the good news:&lt;/strong&gt; it almost always has a fixable cause, and you can usually identify it in under ten minutes if you know where to look. This guide walks through everything, what the error actually means, why it happens, how to diagnose it systematically, and how to fix it. Let’s get into it.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;HTTP 503 means your server can’t handle requests right now, temporarily or otherwise&lt;/li&gt;
&lt;li&gt;The most frequent causes include server overload, scheduled maintenance, application process failures, incorrect firewall configurations, and DNS-related problems.&lt;/li&gt;
&lt;li&gt;Diagnosis starts with checking server resource usage and reading logs&lt;/li&gt;
&lt;li&gt;Most 503 errors clear within minutes; persistent ones usually need manual intervention&lt;/li&gt;
&lt;li&gt;ServerAvatar’s dashboard gives you resource monitoring, process management, and log access in one place, no CLI required for most diagnoses&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Is HTTP 503, Really?
&lt;/h2&gt;

&lt;p&gt;503 is a status code in the 5xx range, which means something went wrong on the server side. Unlike 404 (not found) or 403 (forbidden), a 503 isn’t telling you the resource doesn’t exist; it’s telling you the server exists but can’t respond right now.&lt;/p&gt;

&lt;p&gt;Here’s the part most people skip: 503 is a signal, not a diagnosis. It doesn’t tell you why the server is unavailable. That ambiguity is what makes it tricky. The cause could be as simple as a background service that crashed or as complex as a database server running out of memory.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1teq8gfmhmq8wooyvix3.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1teq8gfmhmq8wooyvix3.jpg" alt="HTTP 503 Service Unavailable Error" width="800" height="262"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;On the user’s end, the only real option is to wait a bit and attempt it again later. From a developer or sysadmin perspective, you’ve got work to do.&lt;/p&gt;

&lt;p&gt;One important distinction: 503 can be temporary or permanent, depending on what’s causing it. A server under a DDoS attack might recover once traffic normalizes. A misconfigured firewall rule, on the other hand, will keep throwing 503 indefinitely until someone fixes it.&lt;/p&gt;

&lt;h2&gt;
  
  
  HTTP 503 vs Other Common HTTP Errors
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd36t7p3cvj7als9kzk0g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fd36t7p3cvj7als9kzk0g.png" alt="Comparison tavle" width="799" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why 503 Errors Happen: The Real Causes
&lt;/h2&gt;

&lt;p&gt;Let me group these by where the problem originates, because that’s how you actually troubleshoot.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/fix-http-503-service-unavailable-error/" rel="noopener noreferrer"&gt;https://serveravatar.com/fix-http-503-service-unavailable-error/&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>devops</category>
      <category>tutorial</category>
      <category>http</category>
    </item>
    <item>
      <title>How to Find Large Files and Directories in Linux</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Fri, 21 Aug 2026 06:33:55 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-find-large-files-and-directories-in-linux-3kp2</link>
      <guid>https://dev.to/serveravatar/how-to-find-large-files-and-directories-in-linux-3kp2</guid>
      <description>&lt;p&gt;Disk space doesn’t vanish, it accumulates. One day your server is fine; the next, find large files and directories in Linux to uncover what filled your storage.&lt;/p&gt;

&lt;p&gt;This is one of the most common scenarios I encounter in day-to-day server management. And on Linux, unlike desktop operating systems, there’s no friendly animation telling you where space went. You have to find it yourself.&lt;/p&gt;

&lt;p&gt;The good news: Linux ships with powerful built-in tools for exactly this. And there are lightweight third-party utilities that make the process much less painful. I’ve used these tools across dozens of servers, development boxes, production VPS instances, and everything in between. Some of them have saved me hours of detective work.&lt;/p&gt;

&lt;p&gt;This guide walks you through how to find large files and directories in Linux, from quick one-liners to interactive analyzers, and explains the nuances that documentation rarely covers.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ki32tti169p1lnh1fj5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5ki32tti169p1lnh1fj5.png" alt="disk usage warning - find large files and directories in Linux" width="800" height="418"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Disk Space Management Matters on Linux
&lt;/h2&gt;

&lt;p&gt;Running out of disk space can affect much more than file storage. A nearly full filesystem can prevent applications from writing data, break database operations, interrupt deployments, and cause system services to fail.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Common sources of unexpected disk usage include:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Log files&lt;/strong&gt; that continuously grow because of application errors or verbose logging.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Learn more about Linux logging, common log locations, and how log files are used in our guide to &lt;a href="https://serveravatar.com/linux-logs/" rel="noopener noreferrer"&gt;Linux logs&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Database backups and snapshots&lt;/strong&gt; that are never removed.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compressed backup archives&lt;/strong&gt; such as .rar, .zip, and .tar files can also consume significant storage when old copies are retained.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;If you need to work with RAR archives on Linux, see our guide on &lt;a href="https://serveravatar.com/rar-files-in-linux/" rel="noopener noreferrer"&gt;How to Open, Extract and Create RAR Files in Linux&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Container images and volumes&lt;/strong&gt; left behind after testing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CI/CD build artifacts&lt;/strong&gt; that accumulate over time.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Package caches&lt;/strong&gt; containing outdated packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Temporary files&lt;/strong&gt; created by applications and system processes.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Old application releases&lt;/strong&gt; that are no longer required.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Backup jobs&lt;/strong&gt; writing files to an unexpected location.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Why regular disk checks are important
&lt;/h3&gt;

&lt;p&gt;A simple disk-space monitoring routine can help you:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Detect storage problems before they become critical.&lt;/li&gt;
&lt;li&gt;Identify which filesystem is filling up.&lt;/li&gt;
&lt;li&gt;Find unusually large directories and files.&lt;/li&gt;
&lt;li&gt;Discover deleted files that are still consuming space.&lt;/li&gt;
&lt;li&gt;Prevent applications from failing because of insufficient storage.&lt;/li&gt;
&lt;li&gt;Keep production servers healthy and predictable.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Don’t wait until a filesystem reaches 100%. Investigate sustained usage above &lt;strong&gt;80%&lt;/strong&gt; and treat &lt;strong&gt;90%+&lt;/strong&gt; as a warning that requires attention.&lt;/p&gt;

&lt;h2&gt;
  
  
  Check Overall Disk Usage First
&lt;/h2&gt;

&lt;p&gt;Before searching for individual files, determine which filesystem is consuming the most space.&lt;/p&gt;

&lt;p&gt;The df command provides a summary of disk usage for mounted filesystems.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df -h
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The -h flag gives you human-readable output, gigabytes and megabytes instead of raw block counts.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiv8q9rp3fjzdwlx4kx0k.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fiv8q9rp3fjzdwlx4kx0k.jpg" alt="check disk usage to find large files and directories in Linux" width="800" height="88"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;You can also review the &lt;a href="https://www.man7.org/linux/man-pages/man1/df.1.html?ref=serveravatar.com" rel="noopener noreferrer"&gt;official GNU ‘df’ documentation&lt;/a&gt; for additional options such as -i, -T, and -x.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here’s what the output typically looks like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Filesystem     Size   Used   Avail   Use%   Mounted on
/dev/sda1      100G    78G     22G    78%   /
/dev/sdb1      500G   450G     50G    90%   /mnt/backup
tmpfs          2.0G      0    2.0G     0%   /tmp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Pay particular attention to:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Size:&lt;/strong&gt; Total filesystem capacity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Used:&lt;/strong&gt; Space currently occupied.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Avail:&lt;/strong&gt; Remaining available space.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use%:&lt;/strong&gt; Percentage of the filesystem in use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Mounted on:&lt;/strong&gt; Location where the filesystem is accessible.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In the example above, /mnt/backup is at &lt;strong&gt;90%&lt;/strong&gt;, making it the first location to investigate.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For more details about df, du, and other filesystem utilities, see the &lt;a href="https://www.gnu.org/software/coreutils/manual/coreutils.html?ref=serveravatar.com" rel="noopener noreferrer"&gt;GNU Coreutils documentation&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Check inode usage
&lt;/h3&gt;

&lt;p&gt;Disk space isn’t the only resource that can run out. Linux filesystems also have a finite number of inodes, which store metadata about files.&lt;/p&gt;

&lt;p&gt;Check inode consumption with:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;df -i
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here’s what the output typically looks like:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkac4ibojl26d8cec9q6r.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Fkac4ibojl26d8cec9q6r.jpg" alt="check linode usage for find large files and directories in Linux" width="800" height="91"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inode exhaustion can occur when a server contains millions of small files, even when plenty of disk capacity remains.&lt;/p&gt;

&lt;p&gt;For example:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A server may have 100 GB of free disk space.&lt;/li&gt;
&lt;li&gt;But all available inodes may already be consumed.&lt;/li&gt;
&lt;li&gt;Creating a new file can then fail despite the available storage.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For a deeper explanation of what an inode stores, see the Linux ‘inode(7)’ manual page.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/find-large-files-directories-linux" rel="noopener noreferrer"&gt;https://serveravatar.com/find-large-files-directories-linux&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>bash</category>
      <category>devops</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>What Is Laravel Octane? Benefits, Features &amp; How to Use It</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Thu, 20 Aug 2026 06:00:00 +0000</pubDate>
      <link>https://dev.to/serveravatar/what-is-laravel-octane-benefits-features-how-to-use-it-5h01</link>
      <guid>https://dev.to/serveravatar/what-is-laravel-octane-benefits-features-how-to-use-it-5h01</guid>
      <description>&lt;p&gt;If you’ve been working with Laravel Octane for a while, you’ve probably noticed something: every time a user hits your site, Laravel has to boot itself from scratch. Service providers load, the container registers, middleware fires, all for a single request that might take 50 milliseconds. Multiply that by a thousand concurrent users, and you’re asking PHP to do an enormous amount of repeated work. Laravel Octane addresses this bottleneck by keeping your application in memory between requests, reducing repeated bootstrapping and helping improve application performance.&lt;/p&gt;

&lt;p&gt;That’s the exact problem Laravel Octane was built to solve.&lt;/p&gt;

&lt;p&gt;In this guide, I’m going to walk you through what Laravel Octane is, how it changes the way your PHP application handles requests, which server options you have, and whether it’s worth adding to your stack. I’ve been running Laravel applications for a few years now, and I’ve tested Octane on both small side projects and production apps handling real traffic. I’ll share what actually matters, not just the marketing version.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Laravel Octane keeps the framework booted in memory, eliminating 30–100ms of boot overhead on every request&lt;/li&gt;
&lt;li&gt;Traditional Laravel handles 300–600 requests/second; Octane pushes 1,800–3,000+ requests/second on the same hardware&lt;/li&gt;
&lt;li&gt;Choose RoadRunner for easy setup and broad compatibility, or Swoole for maximum performance and advanced features&lt;/li&gt;
&lt;li&gt;Key features include persistent workers, concurrent task processing (Swoole), ticks/intervals (Swoole), Octane cache, and Octane tables&lt;/li&gt;
&lt;li&gt;Requires PHP 8.0+ and a server where you control the PHP environment&lt;/li&gt;
&lt;li&gt;Not suitable for shared hosting or teams unfamiliar with stateful PHP patterns&lt;/li&gt;
&lt;li&gt;Test thoroughly before production deployment, particularly around memory usage and global state&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Laravel Octane Actually Is
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://github.com/laravel/octane?ref=serveravatar.com" rel="noopener noreferrer"&gt;Laravel Octane&lt;/a&gt; is an official Laravel package (created by Taylor Otwell) that dramatically speeds up your Laravel application by keeping the framework booted in memory between requests.&lt;/p&gt;

&lt;p&gt;Think of it like this: a traditional Laravel app is like a restaurant where the kitchen staff has to set up all their ingredients, turn on every burner, and prep every dish from zero every time someone orders. Laravel Octane is like a kitchen where everything stays hot and ready, you just plate and serve.&lt;/p&gt;

&lt;p&gt;Technically, Octane runs your Laravel app on top of a high-performance PHP server, either Swoole or RoadRunner, instead of the traditional PHP-FPM approach. This lets PHP hold the framework in memory across multiple requests, eliminating the boot-time overhead that happens on every single page load.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One important thing to know:&lt;/strong&gt; Octane requires PHP 8.0 or higher. If you’re on an older version, that’s the first thing to sort out before even thinking about Octane.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1zd30sdplc4xkoiosrek.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F1zd30sdplc4xkoiosrek.jpg" alt="Laravel Octane" width="745" height="363"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The Performance Problem with Traditional Laravel
&lt;/h2&gt;

&lt;p&gt;Here’s what actually happens when a request hits a standard Laravel app running on Nginx and PHP-FPM:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;PHP-FPM spins up a worker process&lt;/li&gt;
&lt;li&gt;That worker loads your Laravel app&lt;/li&gt;
&lt;li&gt;All service providers register themselves&lt;/li&gt;
&lt;li&gt;The framework boots&lt;/li&gt;
&lt;li&gt;Middleware runs&lt;/li&gt;
&lt;li&gt;Your controller does its work&lt;/li&gt;
&lt;li&gt;A response goes back&lt;/li&gt;
&lt;li&gt;The worker sits idle or gets recycled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This cycle repeats for every single request. On a low-traffic site, you won’t notice. But when you’re handling even a few hundred requests per second, you’re wasting server resources booting the same framework over and over instead of doing actual work.&lt;/p&gt;

&lt;p&gt;The numbers add up fast. A typical Laravel app spends 30–100ms just on framework boot, before your controller even runs. That’s a massive tax on every request.&lt;/p&gt;

&lt;h3&gt;
  
  
  How Octane Fixes It
&lt;/h3&gt;

&lt;p&gt;Instead of booting fresh for each request, Octane boots the framework once and keeps it in memory. When a request comes in, a worker picks it up, runs it through the already-booted framework, and sends the response back, without ever re-booting.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The result?&lt;/strong&gt; Your application spends its CPU cycles on your code, not on Laravel’s boot process. For I/O-heavy applications, API endpoints hitting databases, external APIs, and queue workers, this is a game-changer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/laravel-octane" rel="noopener noreferrer"&gt;https://serveravatar.com/laravel-octane&lt;/a&gt;&lt;/p&gt;

</description>
      <category>laravel</category>
      <category>php</category>
      <category>webdev</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to Open, Extract and Create RAR Files in Linux</title>
      <dc:creator>Meghna Meghwani</dc:creator>
      <pubDate>Wed, 19 Aug 2026 07:33:31 +0000</pubDate>
      <link>https://dev.to/serveravatar/how-to-open-extract-and-create-rar-files-in-linux-h63</link>
      <guid>https://dev.to/serveravatar/how-to-open-extract-and-create-rar-files-in-linux-h63</guid>
      <description>&lt;p&gt;Picture this: You’ve been handed SSH access to a client’s production server. Your job is to pull logs, create RAR Files in Linux, and bring them for analysis. Simple enough, until you realize the directory you need to archive contains hundreds of files, and the upload limit on the client’s portal only accepts archives under 50 MB.&lt;/p&gt;

&lt;p&gt;You could zip everything. But the logs total 200 MB uncompressed, and you need the archive to split cleanly into parts so each chunk uploads independently. That’s when someone on the team says: “Just use RAR”.&lt;/p&gt;

&lt;p&gt;If you’ve heard of RAR but never quite understood when or why you’d reach for it on a Linux server, this guide is for you. We’re going to walk through everything from what the RAR format actually is, to extracting your first archive, creating password-protected archives, splitting large files, and knowing when RAR is the right tool versus when something like ZIP or tar would serve you better.&lt;/p&gt;

&lt;p&gt;By the end, you’ll be comfortable working with RAR files on any Linux machine, and more importantly, you’ll know when to reach for a different tool altogether.&lt;/p&gt;

&lt;h2&gt;
  
  
  TL;DR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;RAR is a compressed archive format that handles large file splitting and optional encryption well&lt;/li&gt;
&lt;li&gt;On Ubuntu/Debian, install with sudo apt-get install unrar rar&lt;/li&gt;
&lt;li&gt;Extract with unrar x archive.rar or unrar x archive.rar /destination/&lt;/li&gt;
&lt;li&gt;Create with rar a archive_name.rar files_or_folder&lt;/li&gt;
&lt;li&gt;Add -p flag for password protection; use -v[size] to split archives&lt;/li&gt;
&lt;li&gt;Test archives before sharing with unrar t archive.rar&lt;/li&gt;
&lt;li&gt;For most Linux use, ZIP and tar.gz are more widely compatible, but RAR wins for split archives and Windows cross-compatibility&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What Is the RAR Format? Why Does It Still Exist?
&lt;/h2&gt;

&lt;p&gt;RAR stands for Roshal Archive, named after its original developer Eugene Roshal. It is a compressed archive format used to store one or more files in a single archive. It first appeared in the early 1990s as a Windows-native format designed to compress files more efficiently than the prevailing options at the time.&lt;/p&gt;

&lt;p&gt;The format gained massive popularity on Windows through WinRAR, the de facto tool for handling &lt;strong&gt;.rar&lt;/strong&gt; files on that platform. Even today, you’ll frequently encounter RAR archives when downloading software, game mods, or shared project files from the internet. It’s everywhere, which is precisely why Linux server administrators need to know how to handle them.&lt;/p&gt;

&lt;p&gt;Over time, RAR developed several capabilities that set it apart:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Solid compression:&lt;/strong&gt; RAR groups similar files together during compression, which can produce smaller archive sizes compared to compressing the same files individually.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Recovery records:&lt;/strong&gt; Optional built-in error recovery data lets RAR reconstruct minor archive corruptions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Split archives:&lt;/strong&gt; You can break a large archive into multiple smaller files (like archive.part1.rar, archive.part2.rar, etc.), which is genuinely useful for circumventing upload size limits or fitting files onto smaller storage media.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Password protection:&lt;/strong&gt; AES-256 encryption is available, keeping archive contents private.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For technical details about RAR’s encryption, recovery records, and archive structure, see the &lt;a href="https://www.rarlab.com/technote.htm?ref=serveravatar.com" rel="noopener noreferrer"&gt;official RAR 5.0 format documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That said, RAR is a proprietary format. The official tools (rar and unrar) are closed-source, which matters in some enterprise or open-source-first environments. This is one reason you will see many Linux admins defaulting to ZIP or tar.gz instead.&lt;/p&gt;

&lt;p&gt;You can learn more about the &lt;a href="https://www.rarlab.com/rar_file.htm?ref=serveravatar.com" rel="noopener noreferrer"&gt;RAR file format it’s work&lt;/a&gt; from RARLAB.&lt;/p&gt;

&lt;h2&gt;
  
  
  A Quick Comparison With ZIP and tar.gz
&lt;/h2&gt;

&lt;p&gt;Before we go further, let’s look at how RAR stacks up against the two most common alternatives you’re likely to encounter on Linux.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftopkha00h2ylpm200ky9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2Ftopkha00h2ylpm200ky9.png" alt="Comparison table"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;RAR tends to squeeze out a bit more size reduction than ZIP, especially with mixed file types. Its split archive feature is genuinely harder to replicate with ZIP without a workaround. That said, if you’re working in a purely Linux environment, tar.gz is far more integrated, you’ll find it in cron jobs, backup scripts, and system tooling across virtually every distribution.&lt;/p&gt;

&lt;h2&gt;
  
  
  Before You Start: Installing the RAR Utilities
&lt;/h2&gt;

&lt;p&gt;Here’s something that trips up a lot of beginners: Linux doesn’t ship with RAR support out of the box. Ubuntu, Debian, and most other distributions don’t include these tools in the base installation, you have to add them yourself.&lt;/p&gt;

&lt;p&gt;The good news? It’s a quick install from the default repositories.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt-get &lt;span class="nb"&gt;install &lt;/span&gt;unrar rar
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That’s it. Two commands and you’re ready.&lt;/p&gt;

&lt;p&gt;If you need the official RAR package for Linux, you can also find it on the &lt;a href="https://www.rarlab.com/download.htm?ref=serveravatar.com" rel="noopener noreferrer"&gt;RARLAB download page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Read Full Article:&lt;/strong&gt; &lt;a href="https://serveravatar.com/rar-files-in-linux" rel="noopener noreferrer"&gt;https://serveravatar.com/rar-files-in-linux&lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>opensource</category>
      <category>tutorial</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
