Why are my PHP files not working?

Hostjar.io is designed specifically for hosting static websites, which means it does not support server-side scripting languages like PHP. If you’re trying to upload or run PHP files on Hostjar.io, they will not work as expected.

Why PHP files don’t work on Hostjar.io

  1. Static hosting only:
  1. Hostjar.io serves static files like HTML, CSS, JavaScript, and images.
  2. PHP is a server-side language and requires a server environment to execute, which Hostjar.io does not provide.
  1. No server-side processing:
  1. Static hosting does not support dynamic content generation, database connections, or server-side scripts.

What you can do instead

  1. Convert PHP to static files:
  1. If your site uses PHP for simple tasks (e.g., including headers or footers), consider using static site generators like Jekyll or Hugo.
  1. Use a different hosting provider:
  1. For PHP-based websites, consider using a hosting provider that supports server-side languages, such as shared hosting, VPS, or cloud hosting.
  1. Host static versions of your site:
  1. Export your PHP site as static HTML files and host them on Hostjar.io. Tools like WP2Static can help convert WordPress (PHP) sites to static files.

Need help?

If you’re unsure how to proceed or need assistance, feel free to:

  • Email us at hello@hostjar.io.
  • Click the chat button in the bottom-right corner of the dashboard to connect with our support team.

Was this article helpful?