HHVM + mediawiki 怎麼配置?

來源:互聯網
上載者:User
關鍵字 php hhvm mediawiki nginx
環境:Debian 8 64bit,openresty(nginx加強版)1.9.7.4,HHVM 3.13.1,mediawiki 1.26.2最新版
遇到的問題:HHVM 無法解析php5,瀏覽器會直接下載。(比如訪問wiki首頁時)
相關配置:

/etc/hhvm/php.ini

; php optionssession.save_handler = redissession.save_path = "tcp://localhost:6379"session.gc_maxlifetime = 1440memory_limit = 256M; hhvm specifichhvm.log.level = Warninghhvm.log.always_log_unhandled_exceptions = truehhvm.log.runtime_error_reporting_level = 8191hhvm.mysql.typed_results = false

/etc/hhvm/server.ini

; php optionspid = /var/run/hhvm/pid; hhvm specifichhvm.server.port = 9000hhvm.server.user = wwwhhvm.server.group = wwwhhvm.server.type = fastcgihhvm.server.default_document = index.php,index.php5hhvm.log.use_log_file = truehhvm.log.file = /var/log/hhvm/error.loghhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc

/etc/nginx/hhvm.conf

location ~ \.(hh|php5|php)$ {    fastcgi_keep_conn on;    fastcgi_pass   127.0.0.1:9000;    fastcgi_index  index.php;    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;    include        fastcgi_params;}

/etc/nginx/nginx.conf

省略多餘部分include servers.conf

/etc/nginx/servers.conf

server{    listen   80;    server_name   baike.mpcblab.com;    root   /var/www/html/baike;    index  index.php index.php5 index.html index.htm;    set_real_ip_from  127.0.0.1;    real_ip_header    X-Forwarded-For;    #limit_conn perip 3;    #limit_conn perserver 20;    #limit_rate 1024k;    location /    {    #   rewrite ^/([^?]*)(?:\?(.*))? /index.php5?title=$1&$2 last; //就是這行,注釋了能訪問,不注釋就不會解析而是直接下載,但調用.php5檔案的地方,比如“特殊頁面:版本”還是會直接下載    }        include  hhvm.conf;}

其他的Web服務都正常使用沒有問題,只有mediawiki不行

回複內容:

環境:Debian 8 64bit,openresty(nginx加強版)1.9.7.4,HHVM 3.13.1,mediawiki 1.26.2最新版
遇到的問題:HHVM 無法解析php5,瀏覽器會直接下載。(比如訪問wiki首頁時)
相關配置:

/etc/hhvm/php.ini

; php optionssession.save_handler = redissession.save_path = "tcp://localhost:6379"session.gc_maxlifetime = 1440memory_limit = 256M; hhvm specifichhvm.log.level = Warninghhvm.log.always_log_unhandled_exceptions = truehhvm.log.runtime_error_reporting_level = 8191hhvm.mysql.typed_results = false

/etc/hhvm/server.ini

; php optionspid = /var/run/hhvm/pid; hhvm specifichhvm.server.port = 9000hhvm.server.user = wwwhhvm.server.group = wwwhhvm.server.type = fastcgihhvm.server.default_document = index.php,index.php5hhvm.log.use_log_file = truehhvm.log.file = /var/log/hhvm/error.loghhvm.repo.central.path = /var/run/hhvm/hhvm.hhbc

/etc/nginx/hhvm.conf

location ~ \.(hh|php5|php)$ {    fastcgi_keep_conn on;    fastcgi_pass   127.0.0.1:9000;    fastcgi_index  index.php;    fastcgi_param  SCRIPT_FILENAME $document_root$fastcgi_script_name;    include        fastcgi_params;}

/etc/nginx/nginx.conf

省略多餘部分include servers.conf

/etc/nginx/servers.conf

server{    listen   80;    server_name   baike.mpcblab.com;    root   /var/www/html/baike;    index  index.php index.php5 index.html index.htm;    set_real_ip_from  127.0.0.1;    real_ip_header    X-Forwarded-For;    #limit_conn perip 3;    #limit_conn perserver 20;    #limit_rate 1024k;    location /    {    #   rewrite ^/([^?]*)(?:\?(.*))? /index.php5?title=$1&$2 last; //就是這行,注釋了能訪問,不注釋就不會解析而是直接下載,但調用.php5檔案的地方,比如“特殊頁面:版本”還是會直接下載    }        include  hhvm.conf;}

其他的Web服務都正常使用沒有問題,只有mediawiki不行

自己解決了,參考官方文檔:HHVM Doc
在server.ini加上:hhvm.php_file.extensions["php5"] = ".php5"重啟HHVM即可。

為什麼不用php7呢趕緊拋棄hhvm吧。。。

  • 相關文章

    聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.