hhvm / user-documentation

Documentation for those that use HHVM and write Hack code.
http://docs.hhvm.com/
Other
130 stars 159 forks source link

"Test HHVM" prompting file download instead of rendering HTML #772

Closed eoswald closed 4 years ago

eoswald commented 4 years ago

Please complete the information below:

Where is the problem?

Getting Started/Test HHVM

What is the problem?

Following instructions leads Firefox to prompt download of hello.hack instead of rendering HTML

$ hhvm --version
HipHop VM 3.30.12-0brew (rel)
Compiler: 1572292534_N
Repo schema: fe36a349e5298cd0ba8d3301615dd34e57e9171a

Firefox Developer: 72.0b9 (64-bit) macOS Mojave 10.14.6


Please don't change anything below this point.


lexidor commented 4 years ago

The HHVM version you are running does not understand .hack files. .hack support was added in 4.0.0 and they're are able to be http endpoints by default since 4.0.2. Your version understands .php files, which can contain either PHP of hack code and .hh files, that can only contain hack code. The HHVM version you are running is also unsupported. I recommend upgrading to HHVM 4.8 for that reason alone. HHVM 4+ is unable to execute PHP code. For a list of all backward incompatible changes, visit the blog. If you need help getting some php code into hack code, don't be afraid to ask for help.

eoswald commented 4 years ago

Ah, thank you for pointing that out. Perhaps there should be an HHVM version dropdown at the top similar to the Python docs. Version 4 isn't indicated anywhere on this page: https://docs.hhvm.com/hhvm/getting-started/getting-started

lexidor commented 4 years ago

We could and definitely should show prominently what version of the website you are looking at. We don't (currently) have a way of looking at older versions of the site. However, we already know what hhvm version we are documenting and we even print the into the html. image We can put this on the page somewhere. Where would you like to see that?

If you want to see an older version of the site, we do tag our github repo, so companies that run on older hhvm versions can host their own docs that are relevant to their hhvm version. I don't think this is what you're after, but it is the closest thing to a version switch that we have. If you need some help with that, feel free to ask. You only need a laptop/server that is running linux to get started.

fredemmott commented 4 years ago

We also tag the docker images that are deployed: https://hub.docker.com/r/hhvm/user-documentation/tags

We weren’t putting the HHVM version into the tag around 3.30 though so it’ll be painful to find (and dockerhub’s API got upset when I tried to retroactively add tags for all past deploys....)

eoswald commented 4 years ago

I see, unfortunately I don't have any good suggestions other than maybe noting the docs only apply to 4.0 somewhere on the page. I specifically sought 3.30 because I have a large-ish PHP codebase that I wanted to slowly port to Hacklang so I suppose I'm not the intended audience for this doc.