简体   繁体   English

用Apache 2.4配置HHVM 3.7给了我一个404?

[英]Configuring HHVM 3.7 with Apache 2.4 gives me a 404?

I can't seem to configure HHVM and Apache, it keeps giving me a 404 file not found error. 我似乎无法配置HHVM和Apache,它一直给我一个404文件未找到错误。 My configuration file for the website is saved as www.example.com.conf , it contains: 我的网站配置文件保存为www.example.com.conf ,它包含:

<VirtualHost *:80>
        ServerName website.com
        ServerAdmin mail@website.com

        DocumentRoot /var/www/website.com/public_html/
        ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/website.com.com/public_html/$1

        ErrorLog ${APACHE_LOG_DIR}/error.log
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Note that I've removed my actual website name, but it's for a subdomain so it's this: subdomain.xyz.com . 请注意,我删除了我的实际网站名称,但它是针对子域名的,所以就是这样: subdomain.xyz.com I've tried looking up how to fix this, but whatever I've tried doesn't seem to work; 我已经尝试过如何解决这个问题,但无论我尝试过什么似乎都不起作用; even the GitHub issues people have posted on the official repository don't seem to work. 甚至人们在官方存储库上发布的GitHub问题似乎也不起作用。 I also haven't changed the default apache configuration, the only thing I have changed is the root directory of my website which does much up to the directory in the configuration file above. 我也没有更改默认的apache配置,我唯一改变的是我的网站的根目录,它完成了上面配置文件中的目录。

Any ideas? 有任何想法吗? Thanks. 谢谢。

I know it's been two months already, but maybe it helps someone else (I had a similar issue occur many times when configuring HHVM + Apache2). 我知道已经有两个月了,但也许它可以帮助其他人(我在配置HHVM + Apache2时遇到过类似的问题)。

  1. Try to enable the vhost if you haven't yet done so. 如果尚未启用vhost,请尝试启用它。 Issue sudo a2ensite www.example.com and reload apache afterwards with sudo service apache2 reload . 发出sudo a2ensite www.example.com并在之后使用sudo service apache2 reload加载apache。
  2. If the vhost is ok and you have your browser requests visible in the vhost access log, then it means that it's not Apache2 that's the culprit there. 如果vhost正常并且您在vhost访问日志中看到了浏览器请求,那么这意味着它不是Apache2那里的罪魁祸首。
  3. So if you're still with me and the first two steps didn't help, try the following, although in HHVM 3.7 it shoulnd't be the case anymore (but it might, I just follow the try-and-check method when it comes to configuring HHVM, and it usually works). 因此,如果你仍然和我在一起并且前两个步骤没有帮助,请尝试以下方法,尽管在HHVM 3.7中它不再是这种情况(但它可能,我只是遵循try-and-check方法它来配置HHVM,它通常工作)。 Open /etc/hhvm/server.ini and append the following line to that file: 打开/etc/hhvm/server.ini并将以下行追加到该文件:

     hhvm.server.fix_path_info = true 
  4. After changing the HHVM's configuration, issue sudo service hhvm restart . 更改HHVM的配置后,发出sudo service hhvm restart Then try to refresh your website. 然后尝试刷新您的网站。 It should be all good. 应该都很好。

I had similar issues and back then it was the most common fix on all webservers I configured to work with HHVM. 我有类似的问题,那时它是我配置为使用HHVM的所有Web服务器上最常见的修复。 But, after the latest updates, I had to comment that line out of my hhvm server.ini in order for my code to work - I read that they have somehow changed the parameters of the server and this parameter does no good anymore, AFAIK. 但是,在最新更新之后,我不得不在我的hhvm server.ini中注释该行以便我的代码工作 - 我读到他们已经以某种方式改变了服务器的参数,这个参数不再有好处,AFAIK。

I have also tried to put that line in /etc/hhvm/php.ini but as far as I remember, it should go to server.ini because it's a server parameter. 我也尝试将该行放在/etc/hhvm/php.ini但据我记得,它应该转到server.ini因为它是一个服务器参数。

So. 所以。 Try it and let me know if that helped. 尝试一下,如果有帮助,请告诉我。 If not then please issue the following commands on your webserver and paste the output here, so I can see if you have the necessary modules installed 如果没有,请在您的网络服务器上发出以下命令并将输出粘贴到此处,这样我就可以看到您是否安装了必要的模块

ls  /etc/apache2/mods-available | grep -E 'proxy|alias|fcgi|hhvm'
ls  /etc/apache2/mods-enabled | grep -E 'proxy|alias|fcgi|hhvm'

Oh, and please include your full HHVM and Apache2 version output: 哦,请包括你的完整HHVM和Apache2版本输出:

hhvm --version
apache2 -v

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM