DEV Community

Timothy Adeleke
Timothy Adeleke

Posted on

PHP returning 500 HTTP Error on a parked domain

The setup

I have a Laravel application running on my primary domain, mainapp.com. The Laravel public/ folder is symlinked to a subfolder in the document root, and a custom .htaccess routes everything through it. I was in the process of consolidating several separately-deployed instances of the same app into one, using Hostinger's parked domain feature so all domains point to a single codebase.


What went wrong

I parked four domains on top of mainapp.com. Three of them — alpha.com, beta.com, and gamma.com — worked immediately. The fourth, delta.com, was broken in a very specific way: static files like .svg and .html loaded just fine, but any .php file returned a blank HTTP 500 error. Not a Laravel error page — a raw server-level 500, before PHP even started.

I tested with the simplest possible file:

<?php echo "Hello World"; ?>
Enter fullscreen mode Exit fullscreen mode
  • mainapp.com/test.php — works fine.
  • delta.com/test.php — 500. No output. No logs.

I ruled out .htaccess because the other three domains share the exact same document root and work perfectly. I deleted and re-added delta.com as a parked domain — no change. I waited over 24 hours — still broken. The error logs for delta.com were completely empty, which itself confirmed the failure was happening before PHP was even invoked.


The actual cause

The root issue is that when Hostinger sets up a parked domain, it has to map that domain alias to a PHP handler. Sometimes — and this seems especially likely when the domain was previously configured as a full standalone website on the same hosting account — that handler mapping gets stale, stuck, or simply never gets properly initialized for the new alias.

It has nothing to do with DNS, nothing to do with your .htaccess, and nothing to do with your app code. The server just isn't handing PHP requests for that specific domain to the PHP processor. Static files bypass the PHP handler entirely, which is why they serve correctly — that's the tell.


The fix

  1. In hPanel, go to Hosting → Manage → PHP Configuration for your primary domain.
  2. You don't need to change the version. Just click Save on the current setting, or change the version and revert.
  3. This forces Hostinger to re-provision the PHP handler, which refreshes the mapping for all parked domains — including the broken one.
  4. Test your test.php on the affected domain. It should work immediately.

Why does this work? Saving the PHP version triggers Hostinger's backend to regenerate the server configuration for your hosting account. This rebinds the PHP handler to all current domains, including parked aliases that were previously missed.


TL;DR

If a parked domain on Hostinger serves static files correctly but returns a server-level 500 on all PHP files, your PHP handler isn't mapped to that domain alias. Fix: Go to the PHP settings for your primary domain in hPanel and change the PHP version and save. Takes about 10 seconds.

Top comments (0)