<?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: Ali Raza</title>
    <description>The latest articles on DEV Community by Ali Raza (@aliraza360).</description>
    <link>https://dev.to/aliraza360</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%2F4185848%2Fb5b37a0e-0c8e-4f5b-8396-27e0c5e8f757.png</url>
      <title>DEV Community: Ali Raza</title>
      <link>https://dev.to/aliraza360</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/aliraza360"/>
    <language>en</language>
    <item>
      <title>My PHP + MySQL Stack for Small Business Software in 2026</title>
      <dc:creator>Ali Raza</dc:creator>
      <pubDate>Wed, 21 Oct 2026 12:45:19 +0000</pubDate>
      <link>https://dev.to/aliraza360/my-php-mysql-stack-for-small-business-software-in-2026-20m2</link>
      <guid>https://dev.to/aliraza360/my-php-mysql-stack-for-small-business-software-in-2026-20m2</guid>
      <description>&lt;p&gt;Everyone asks why I still build with PHP and MySQL in 2026. The answer is simple: my clients are small businesses, and small businesses need software that is cheap to host, easy to maintain, and fast to build. For that job, PHP + MySQL is still hard to beat.&lt;/p&gt;

&lt;p&gt;I build lead management tools, courier tracking systems, agency management software, and e-commerce stores with this stack. Here is exactly how I set things up.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Plain PHP, organized like a framework
&lt;/h2&gt;

&lt;p&gt;I don't reach for Laravel on every project. For a small business tool with 10–20 pages, a full framework adds deployment complexity the client will never benefit from. Instead I use plain PHP with a strict folder structure:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/public        → the only web-accessible folder (index.php front controller)
/src           → controllers, models, helpers
/templates     → plain PHP view files, no template engine
/config        → database credentials, constants (outside /public)
/uploads       → user files, blocked from executing PHP via .htaccess
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;One rule I never break: nothing outside &lt;code&gt;/public&lt;/code&gt; is reachable from the web. &lt;code&gt;config.php&lt;/code&gt; with database credentials sits one level above the document root. On cheap shared hosting this single habit prevents the most common credential leaks.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. PDO with prepared statements — no exceptions
&lt;/h2&gt;

&lt;p&gt;Every database query goes through PDO with prepared statements. No string concatenation, ever. It takes five extra seconds per query and eliminates SQL injection completely:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$stmt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$pdo&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;prepare&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT * FROM orders WHERE client_id = ? AND status = ?"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;execute&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="nv"&gt;$clientId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$status&lt;/span&gt;&lt;span class="p"&gt;]);&lt;/span&gt;
&lt;span class="nv"&gt;$orders&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$stmt&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;fetchAll&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="no"&gt;PDO&lt;/span&gt;&lt;span class="o"&gt;::&lt;/span&gt;&lt;span class="no"&gt;FETCH_ASSOC&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I also keep one &lt;code&gt;db.php&lt;/code&gt; that creates a single PDO instance with &lt;code&gt;ERRMODE_EXCEPTION&lt;/code&gt; and &lt;code&gt;utf8mb4&lt;/code&gt; charset. Every page includes it. Consistent, boring, reliable.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. One shared hosting account per client
&lt;/h2&gt;

&lt;p&gt;Small businesses in my market already pay for shared hosting (usually a few dollars a month). My software runs fine on it — no VPS, no Docker, no monthly server bill the client doesn't understand. Deployment is FTP or the host's file manager: upload, import the &lt;code&gt;.sql&lt;/code&gt; schema, done.&lt;/p&gt;

&lt;p&gt;This is a business decision, not a technical limitation. When a client outgrows shared hosting, we migrate. Most never need to.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Server-rendered pages, minimal JavaScript
&lt;/h2&gt;

&lt;p&gt;I render HTML on the server and use vanilla JavaScript only where the page genuinely needs interactivity (live search, form validation, print views). No build step, no npm, no 3MB of JavaScript for a dashboard.&lt;/p&gt;

&lt;p&gt;The result: admin panels that load in under a second on a phone with a weak connection. My clients notice this. Their staff uses these tools on mobile data all day.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Backups the client can understand
&lt;/h2&gt;

&lt;p&gt;Every system I ship has a one-click database backup in the admin panel that downloads a &lt;code&gt;.sql&lt;/code&gt; file. I also tell the client to download one monthly. Fancy automated backup pipelines are great, but a client who can restore their own data from a file they downloaded is better.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I'd do differently at scale
&lt;/h2&gt;

&lt;p&gt;If a project needs real-time features, background jobs, or an API consumed by mobile apps, I switch to Laravel or Node. The plain-PHP approach is a deliberate choice for a specific client profile — not a religion.&lt;/p&gt;

&lt;p&gt;The stack is boring on purpose. Boring means the client's nephew can find a developer to maintain it, the hosting costs almost nothing, and nothing breaks at 2 AM. For small business software, that's the whole job.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I'm Ali Raza, a Full Stack Web Developer from Pakistan. I build custom websites, e-commerce stores, and business software for small businesses. &lt;a href="https://aliraza.mexicancandy.xyz/" rel="noopener noreferrer"&gt;Portfolio&lt;/a&gt; · &lt;a href="https://github.com/alirazawebdev" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt; · &lt;a href="https://www.linkedin.com/in/alirazawebdev2" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

</description>
      <category>php</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>mysql</category>
    </item>
  </channel>
</rss>
