Website security
PHP Security for Businesses: Risks & Fixes (2026)

Your business website, customer portal, billing system or online store may run on PHP. That is not a problem in itself: PHP powers some of the world's biggest sites. Risk builds up when the runtime, plugins and custom code are left without regular maintenance. A site can appear to work normally while still exposing customer data or administrative access.
For businesses anywhere, this is more than an IT issue. A leaked customer database can disrupt operations, damage trust and create obligations under applicable privacy and breach-notification laws. This guide explains common PHP vulnerabilities and practical steps you can take this month.
Where to Start: Set Your Priorities
Ask your developer or hosting provider for a short inventory: the live PHP version, application or CMS version, installed extensions, last successful backup and the person responsible for updates. Check the version serving the website; a command-line PHP version may differ.
- Suspected compromise: unexpected administrator accounts, redirects or changed files need investigation. Preserve logs and involve your hosting provider before routine maintenance changes overwrite evidence.
- Known vulnerable or unsupported software: identify affected components, review available fixes and schedule a tested update. Restrict access to an affected feature while a fix is prepared where practical.
- No immediate incident: verify recovery, test updates on staging and assign an owner to ongoing patching.
Why PHP Maintenance Matters
PHP still runs most of the web
According to W3Techs, PHP is used by 69.1% of websites whose server-side language is known as of 4 November 2026. Among the PHP sites it tracks, 26.2% use PHP 7 and 7.6% use PHP 5. Both branches are long past official support. Those figures are estimates for websites in W3Techs’ survey, not a measure of the risk to any one business.
Internet-facing sites are exposed worldwide
A small business should not assume its website is too minor to attract automated attacks. Internet-facing software can be scanned at scale, regardless of where the business is based.
4 PHP Vulnerabilities That Put Business Websites at Risk
1. Outdated (End-of-Life) PHP versions
PHP publishes supported branches and end-of-life dates. Once a branch reaches end of life, the PHP project no longer provides security fixes for it. PHP 5.x, 7.x, 8.0 and 8.1 are out of support. PHP 8.0 ended support on 26 November 2023 and PHP 8.1 on 31 December 2025. Check the current support table before planning an upgrade; PHP 8.2 is scheduled to reach end of life on 31 December 2026.
Attackers move fast. Take CVE-2024-4577, a critical PHP-CGI flaw affecting certain Windows configurations that allowed remote code execution. Akamai observed exploit attempts one day after disclosure, and Imperva reported attacks distributing TellYouThePass ransomware. This case shows why timely patching matters even for supported software.
Why businesses stay on old PHP: the site "works", the original developer has moved on, and upgrading breaks old code. These are real hurdles, but they can be fixed with a planned migration.
2. Vulnerable WordPress plugins, themes and CMSs
A WordPress site depends on its core software, plugins and themes. Review all three: an abandoned plugin or a component with a known vulnerability can create an entry point even when PHP itself is current.
Keep an inventory, obtain updates from trusted sources and remove components you no longer need. Check compatibility on staging before a live update. Avoid pirated themes and plugins: their origin and update path cannot be trusted. The WordPress hardening guide covers updates, permissions, backups and administration controls.
3. SQL injection (SQLi)
SQL injection occurs when untrusted input changes the meaning of a database query. Depending on the application and database permissions, an attacker may read or alter records. Login forms, searches and URL parameters all need the same care.
The fix: use parameterised queries with bound values through PDO, MySQLi or your framework’s supported database API. Do not join user input into SQL strings. Dynamic column names and sort directions need an explicit allowlist because placeholders cannot represent SQL identifiers. Give the application only the database permissions it needs. See OWASP’s SQL injection prevention guidance.
4. Insecure file uploads
CV uploads, identity documents and product images introduce both security and privacy risks. If uploaded content can execute as code, a malicious file may compromise the application. Private documents also need access controls so one customer cannot retrieve another customer’s files.
The fix: allow only required extensions, inspect file content on the server and set size limits. Do not trust a browser-supplied MIME type alone. Generate storage names, keep files outside the web root where possible and prevent script execution. Require appropriate permissions for uploading and downloading; add malware scanning where appropriate. OWASP’s file upload guidance explains these layered controls.
What a PHP Breach Actually Costs Your Business
Data breach and legal obligations
A breach can expose customer records, interrupt services and trigger notification duties. Privacy and incident-reporting requirements vary by country and by the data involved. Check the rules that apply to your business and prepare a response plan before an incident occurs.
Downtime and ransomware
A compromised server often means days offline while it is rebuilt: no orders, no enquiries, and staff unable to work. Ransomware like TellYouThePass encrypts files and holds them for payment.
SEO blacklisting and lost trust
Hacked PHP sites are often used to host spam pages, phishing kits or malware redirects. Google Safe Browsing then shows visitors a red "Deceptive site ahead" or "This site may harm your computer" warning, and Google Search Console reports a "Security issues" problem. Rankings and traffic that took years to build can collapse within days. Recovery means cleaning the site and requesting a review.
Practical Fixes: Your PHP Security Checklist
Do this week
- Find your PHP version. Check your hosting control panel (cPanel → "Select PHP Version") or ask your developer. If it is below the current supported branches on php.net, plan an upgrade.
- Verify a backup before making changes. Include files and the database, keep a copy separate from the hosting account and confirm a restore works.
- Update WordPress core, plugins and themes on staging first. Remove unused components and test important customer journeys before deployment.
- Remove nulled or pirated themes and plugins. Replace them with licensed or reputable free versions.
- Turn on two-factor authentication for admin, hosting and domain accounts.
Do this month
- Plan the PHP upgrade on a staging copy first. Fix deprecated functions and test every form, payment flow and integration.
- Use prepared statements (PDO or MySQLi with bound parameters) for queries that use untrusted values; allowlist any dynamic identifiers.
- Lock down file uploads. Allow only specific file types, check MIME types on the server, rename files, store uploads outside the web root (or turn off PHP execution in the upload folder), and limit file size.
- Consider a Web Application Firewall (WAF) and malware scanning as additional controls. Neither replaces fixing vulnerable code or keeping software updated.
- Turn off error display in production (
display_errors = Off) and remove oldphpinfo()and test files. - Enforce HTTPS and set security headers.
Make it a habit
- Run a security audit or penetration test at least once a year and after major changes.
- Keep a data inventory: what personal data you collect, where it is stored and who can access it. This also helps you meet applicable privacy obligations.
- Write a simple incident response plan that covers who to call, which authorities and customers must be notified, and when.
- If fraud happens, preserve evidence and report it through the appropriate local authority or cybercrime channel.
How to Fix These Risks on Your Hosting Setup
Start with the same three steps in every environment: record the PHP version and installed plugins, make a restorable backup of both files and database, and test changes on a staging copy. Then follow the path that matches where your site runs.
Shared hosting (cPanel or a similar panel)
- Back up the site and database. In cPanel, use Backup Wizard to download a full account backup; also confirm how your host restores it. cPanel notes that a full backup cannot be automatically restored from the cPanel interface itself.
- Change PHP on a staging site first. In cPanel's MultiPHP Manager, select the domain, choose a currently supported PHP version and click Apply. If the version is unavailable, ask the host to install or enable it. Test forms, checkout and plugins before changing the live domain.
- Update the application. Update WordPress core, themes and plugins; remove unused plugins. WordPress also recommends disabling its built-in PHP file editor and keeping reliable backups.
- Ask the host what it manages. Confirm server patching, malware scanning, WAF options and backup retention. You can update your application, but shared-hosting customers usually cannot patch the host's operating system or web server.
VPS (a server you administer)
- Inventory the whole stack. Check the operating system, PHP runtime, web server, database and application versions. Take a server snapshot and a separate database backup before upgrading.
- Patch the server and PHP. Use your distribution's supported packages and security-update process, then test the site on staging. On Ubuntu, unattended-upgrades can apply security updates, but verify its settings and monitor failed updates. Plan major PHP upgrades separately because application code may need changes.
- Limit access. Keep only required web ports public, restrict administrative access, use SSH keys and MFA where available, and give the web application only the file and database permissions it needs. Keep uploaded files from executing PHP.
- Check recovery. Send backups off the server, test a restore, and review web, PHP and authentication logs regularly. A snapshot on the same server is not a complete recovery plan.
Cloud hosting (virtual machines or managed services)
- Identify who patches each layer. A cloud VM is much like a VPS: you remain responsible for its guest operating system, PHP and application. Managed services may patch more of the platform. AWS's shared-responsibility guidance illustrates why the answer depends on the service you use.
- Lock down the deployment. Give each person and service only the access it needs, require MFA for administrator accounts, keep databases and admin interfaces off the public internet where possible, and use managed secrets instead of credentials in code.
- Deploy safely. Update PHP and dependencies in a test environment, run the site's key flows, then deploy with a rollback plan. Configure HTTPS, a WAF if appropriate, central logs and alerts for unusual activity.
- Prove backups work. Keep versioned backups of files and data in a separate location, set retention, and rehearse restoration. Check both the provider's backup settings and your own application-level data.
If a site may already be compromised, pause routine upgrades. Preserve logs and a copy of the affected system, limit access, and get incident-response help before replacing files or restoring a backup. Otherwise, you may erase evidence or put the same vulnerable site back online.
How Defenzelite Can Help
Defenzelite Private Limited helps businesses worldwide secure and modernise their PHP applications with staged testing and a planned release:
- PHP security audit: a vulnerability assessment of your code, server setup, plugins and CMS, delivered as a clear, prioritised report.
- PHP version upgrade and migration: moving from PHP 5 or 7 to a supported PHP 8.x release, refactoring legacy code and testing on staging before go-live.
- WordPress hardening and cleanup: plugin review, malware removal, WAF setup and Google blacklist recovery.
- Secure development: new websites, web apps and mobile apps built with security from the start, plus automation and digitalisation for your operations.
Not sure how exposed your website is? Discuss a PHP security review with Defenzelite. Share your website URL, hosting setup and the issue you want to address. You can also call +91 80851 22017 or email sales@defenzelite.com. Do not send passwords or customer records in an initial enquiry.
Sources
-
Akamai SIRT, CVE-2024-4577 exploitation