0

Reproduceable problem description:

When installing HipHop / HHVM via the official way [1][2], and then running the built-in server [3] from /var/www via

cd /var/www
sudo hhvm -m server

it will render a custom "404 File Not Found" message to the browser, regardless of /var/www's contents when moving to the server's root:

http://111.111.111.111/

However, HipHop will run perfectly when a filename is given, like

http://111.111.111.111/index.php

Filling the index.php with phpinfo() will also show "hiphop" as feedback, indicating that this PHP file is correctly parsed by HipHop.

Question:

How to let HipHop's server run index.php (etc.) by default when navigating to the server's root, like Nginx and Apache do ?

Update:

Seems to be a common issue: [4], [5]

Sliq
  • 15,937
  • 27
  • 110
  • 143
  • So this question isn't really about 404s, but about setting up your default index page. Can you fix the title please? – Lightness Races in Orbit Feb 02 '14 at 02:01
  • @LightnessRacesinOrbit I totally agree, but the 404 error message in the title might lead people with the same problem to this Q/A via Google. What do you think, is this a valid reason for keeping the title ? – Sliq Feb 02 '14 at 02:03
  • I think it's too general. A question about 404s could be almost anything, but in this case you are asking how to configure something very specific. – Lightness Races in Orbit Feb 02 '14 at 02:03

2 Answers2

2

According to the documentation, the config.hdf file has a DefaultDocument directive. Set that.

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
  • 1
    The `DefaultDocument = index.php` is set in `server.hdf` (needs to be in there, not in config.hdf afaik) by default (and in my setup too), the problem still exists. – Sliq Feb 02 '14 at 02:08
  • @Panique: Can you show any evidence for this `server.hdf` theory of yours? I've not looking into it too deeply but I saw no hint of that in the documentation I linked you to. – Lightness Races in Orbit Feb 02 '14 at 02:28
1

For HHVM 3.0 you specify it in a ini config file with this:

  hhvm.server.default_document = index.php
Ray
  • 40,256
  • 21
  • 101
  • 138