keepcalculator

06 Numbers and Powers

PHP Hosting Requirements & Security Features

Card No. 06·72425 · Updated · Standard formula, shown below

Choosing the right PHP hosting plan means matching server resources to your application’s needs while ensuring the environment is hardened against common attacks. This guide walks you through the technical requirements to check (PHP version, extensions, database support, performance limits) and the security features that matter (SSL, firewalls, backups, isolation). You’ll leave with a clear checklist you can use to compare hosts.

What You’ll Need

  • A list of your application’s requirements: PHP version, database type (MySQL, PostgreSQL), and any required extensions (e.g., mysqli, GD, curl).
  • An estimate of your expected traffic and storage needs.
  • Access to your current hosting control panel (if migrating) to check existing resource usage.

Step-by-Step

  1. Determine your PHP version requirement. Check your application’s documentation or run php -v on your current server. As of 2025, PHP 8.1 or newer is recommended for security and performance. If your app is legacy, you may need PHP 7.4, but that version is end-of-life and should be avoided unless absolutely necessary.
  2. List required PHP extensions. Common ones include pdo_mysql, mysqli, gd, curl, mbstring, xml, and zip. Check your app’s requirements or run php -m to see what’s already enabled. When comparing hosts, look for those that allow you to enable/disable extensions via a control panel or configuration file.
  3. Check database support. Most PHP apps use MySQL or MariaDB. Ensure the host offers the database version you need (e.g., MySQL 8.0). Also check if you get phpMyAdmin or a similar tool for management.
  4. Evaluate performance resources. Look at CPU, RAM, and storage limits. Shared hosting often caps CPU at a percentage (e.g., 25% of a core). For WordPress or Laravel, 2GB RAM and 20GB SSD storage is a comfortable starting point. If you expect high traffic, consider VPS or dedicated plans.
  5. Verify PHP configuration options. You may need to adjust memory_limit, upload_max_filesize, or max_execution_time. Check if the host allows custom php.ini or .user.ini files. Some apps require certain settings (e.g., allow_url_fopen).
  6. Confirm SSL/TLS support. Ensure free Let’s Encrypt certificates are available, and that you can force HTTPS via .htaccess or a control panel toggle. Check if the host supports HTTP/2 or HTTP/3 for performance.
  7. Review security features. Look for: malware scanning, DDoS protection, a web application firewall (WAF), and automatic backups (daily or weekly). Check if backups are stored off-site and how to restore them.
  8. Check isolation and permissions. On shared hosting, ensure the host uses mod_lsapi, suPHP, or similar to run PHP scripts as your user, not as the server user. This prevents other users from reading your files. Also verify that you can set file permissions (e.g., 644 for files, 755 for directories).
  9. Test the control panel. A good panel (cPanel, Plesk, or custom) should let you manage domains, databases, cron jobs, and email. For security, you should be able to set up two-factor authentication (2FA) on your account.
  10. Check support and uptime guarantees. Look for 24/7 support with real response times. An uptime guarantee of 99.9% is standard. Read reviews to see if the host honors their SLA.

Common Mistakes

  • Ignoring PHP version compatibility. Choosing a host with PHP 8.3 when your app requires PHP 7.3 will break the site. Always match the version exactly.
  • Overlooking extension availability. Some hosts disable certain extensions (like exec or putenv) for security. If your app needs them, you may need a VPS.
  • Assuming all shared hosting is the same. Resource limits vary widely. A host that oversells CPU can make your site painfully slow even with “unlimited” bandwidth.
  • Skipping backup verification. Many hosts offer backups, but you may not be able to restore them easily. Test the restore process on a staging site if possible.
  • Not checking if the host supports SSH. For serious development, SSH access is essential. Some shared hosts only offer FTP, which is less secure and less flexible.

Tips

  • Start small, but plan to scale. Choose a host that offers easy upgrades from shared to VPS without migrating manually.
  • Use a staging environment. Many hosts provide a staging site for free. Use it to test PHP version changes or new extensions before going live.
  • Enable automatic updates. If your host supports it, enable automatic security updates for your PHP version and any CMS you use (like WordPress).
  • Use a CDN. A content delivery network can offload static assets and reduce server load, which helps if you’re on a small shared plan.
  • Read the fine print on “unlimited” resources. They often have fair-use policies that throttle CPU or inodes. Clarify what “unlimited” actually means.

Troubleshooting

  • If your site shows a blank page after switching hosts: Check the PHP version and error logs. Enable error reporting in php.ini or via error_reporting(E_ALL) in a test script.
  • If you can’t connect to the database: Verify the database hostname (often localhost, but sometimes a remote host) and that the user has privileges on the database. Check the port (default 3306).
  • If file uploads fail: Check upload_max_filesize and post_max_size in your PHP settings. Also check the folder permissions where files are stored.
  • If your site is slow: Use a tool like GTmetrix to see if it’s a server response time issue. If it is, you may need to upgrade your plan or optimize your code (e.g., enable opcache).
  • If you get a 500 error after changing .htaccess: Rename the .htaccess file to temporarily disable it, then fix the rules. Common mistakes include missing spaces or using unsupported directives.

Frequently Asked Questions

  1. What is the minimum PHP version for WordPress in 2025? WordPress recommends PHP 7.4 or higher, but for security and performance, PHP 8.0+ is strongly advised. Many hosts default to PHP 8.1 or 8.2.
  2. Do I need a VPS or is shared hosting enough? For small to medium traffic sites (up to a few thousand daily visitors) and simple apps, shared hosting with good caching can suffice. For custom applications with heavy database usage or high traffic, a VPS gives you more control and predictable performance.
  3. What is the difference between PHP-FPM and mod_php? PHP-FPM runs as a separate process and is more efficient, especially with high traffic. mod_php runs inside Apache and can be easier to set up but uses more memory. Most modern hosts use PHP-FPM.
  4. How do I check if a host supports the extensions I need? Look at the host’s feature list or contact support. On a trial account, you can run phpinfo() to see the exact extensions and settings.
  5. Are free SSL certificates secure? Yes, Let’s Encrypt certificates are just as secure as paid ones. They are widely used and trusted by all browsers. The main difference is that they expire every 90 days, but hosts usually auto-renew them.
  6. What is a web application firewall (WAF) and do I need it? A WAF filters out malicious traffic before it reaches your site. It’s especially important for PHP apps that handle user input. Many hosts include a basic WAF, but you can also use Cloudflare’s free plan for additional protection.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →