hhvm

extremely slow HHVM, Wordpress, Nginx

醉酒当歌 提交于 2019-12-04 06:02:16
I might be doing something wrong but I am doing a bit of testing between a php-fpm wordpress setup and a HHVM wordpress setup. I've heard & seen many mind blowing results from HHVM, but I'm just shocked at the results I'm getting. Using the following apache testing command I'm getting a much higher performance rate from php-fpm than HHVM. ab -n1000 http://127.0.0.1:8080/ For php-fpm I am getting 109.98 requests/second. Unfortunately for me I'm getting only ~12.33 requests/second with HHVM. These tests are done on a standard fresh Wordpress install. I must be doing something wrong in my

Running phpunit tests using HHVM (HipHop)

痴心易碎 提交于 2019-12-04 02:05:20
I am trying to run PHPUnit unit tests via HHVM on a virtual Ubuntu 12.04 (64-bit Server) install. The tests usually run using a phpunit.xml file located in my tests directory, which includes a bootstrap file to handle autoloading, and the tests run fine on an ordinary php install. However, I keep getting: HipHop Fatal error: File not found: File/Iterator/Autoload.php in /usr/share/php/PHPUnit/Autoload.php on line 64 When running: hhvm -f /usr/bin/phpunit /path/to/my/testsDirectory/SomeTest.php And I haven't been able to figure out how to run phpunit under hhvm using a bootstrap or config file.

PHP - static type checking a-la PhpStorm

瘦欲@ 提交于 2019-12-02 20:51:41
I am a strongly-typed language supporter but I am working on a big PHP project. I have been using PhpStorm and I love the extra type hinting you can provide, with comments like these: /** @var \Payments $payment */ /** @property \Payments $payment */ PhpStorm is great because it gives you some warning when types don't match. I was wondering if it is possible to have this kind of check also statically, outside of PhpStorm. Some kind of command line precompiler that would go through the code, checking also those extra hints, to show some error if a mismatch is detected. Is that something that

Display fatal/notice errors in browser

北战南征 提交于 2019-11-30 19:17:39
Well I just started with hhvm/hack. But I wanted to display the errors to the browser but didnot got it working. I set the ini settings as followed error_reporting(E_ALL); ini_set('display_errors', '1'); According to a var_dump of ini_get the values were set to string(5) "32767" string(1) "1" But when I did <?hh error_reporting(E_ALL); ini_set('display_errors', '1'); throw new InvalidArgumentException('test'); When I visited the page via de browser I would just get a white screen and a 500 http header. So no explaintion of the fatal/exception error. Would I however go via the terminal hhvm

hhvm-fastcgi + nginx how to make it display fatal errors in the browser

痴心易碎 提交于 2019-11-30 17:30:19
I've been playing with HHVM config file and I have yet to be able to make it output any fatal error to the browser. It displays E_NOTICE and E_WARNING but when any E_ERROR happens it leaves the page blank and the error only appears in the HHVM log file. Is there a way to make it show in the browser? My HHVM config file is as follow: PidFile = /var/run/hhvm/pid Log { Level = Warning AlwaysLogUnhandledExceptions = true RuntimeErrorReportingLevel = 8191 UseLogFile = true UseSyslog = false File = /var/log/hhvm/error.log InjectedStackTrace = false NativeStackTrace = false Access { * { File = /var

PHP7通过yum源安装及性能测试

China☆狼群 提交于 2019-11-30 14:39:55
PHP7与HHVM 提到PHP,肯定会有人说这是世界上最好的编程语言。单说流行程度,目前全球超过81.7%的服务器后端都采用了PHP语言,它驱动着全球超过2亿多个网站。上月初PHP7正式版发布,迎来自2004年以来最大的版本更新。现在PHP 7.0正式发布。 对于普通的PHP网站,主要是IO密集型的,瓶颈在MySQL数据之上,体现不出来PHP性能的劣势。但在密集计算方面比C、C++、Java这种静态编译型语言差几十倍甚至上百倍。如果在PHP开发中使用了比较复杂的框架,如symfony,程序性能会明显下降。事实上,PHP语言最初的设计,就不是用来解决计算密集型的应用场景。我们可以这样粗略理解为,PHP为了提升开发效率,而牺牲了执行效率。 但PHP比较流行,如新浪微博、Facebook这种大型网站大部分程序都是使用PHP写的,也就是在这种大规模应用下,PHP性能低下就显现出来了。Facebook早期的很多代码是使用PHP来开发的,但是,随着业务的快速发展,PHP执行效率成为越来越明显的问题。为了优化执行效率,Facebook在2008年就开始使用HipHop,这是一种PHP执行引擎,最初是为了将Fackbook的大量PHP代码转成 C++,以提高性能和节约资源。使用HipHop的PHP代码在性能上有数倍的提升。后来,Facebook将HipHop平台开源,逐渐发展为现在的HHVM

How to programmatically check if running on HHVM?

偶尔善良 提交于 2019-11-30 06:06:47
I need to run a given package on both HHVM runtime and traditional PHP runtime. My question: is there a way to check programmatically if current environment is HHVM? Something like this: <?php if(running_on_hhvm()) { // do hhvm compatible routine } else { // do normal routine } You can utilise the constant HHVM_VERSION specific to HHVM: if (defined('HHVM_VERSION')) { // Code } You can put this in your own function if you want. function is_hhvm() { return defined('HHVM_VERSION'); } if (is_hhvm()) { // Code } Source: http://www.hhvm.com/blog/2393/hhvm-2-3-0-and-travis-ci Some older versions of

HHVM+Hacklang: errors/warnings output into browser

假装没事ソ 提交于 2019-11-29 07:41:05
Is there any way to tell HHVM to output Hacklang warnings and errors into the browser? Something like PHP does with enabled display_errors , display_startup_errors and error_reporting set to E_ALL HHVM version: $ php -v HipHop VM 3.1.0-dev+2014.04.09 (rel) Compiler: heads/master-0-g4fc811c64c23a3686f66a2bea80ba47f3eaf9f3d Repo schema: 79197c935790c0b9c9cb13566c3e727ace368117 I've tried the following config: $ cat /etc/hhvm/php.ini ; php options display_startup_errors = On error_reporting = E_ALL display_errors = On ; hhvm specific hhvm.log.level = Warning hhvm.log.always_log_unhandled

How to programmatically check if running on HHVM?

我们两清 提交于 2019-11-29 06:36:20
问题 I need to run a given package on both HHVM runtime and traditional PHP runtime. My question: is there a way to check programmatically if current environment is HHVM? Something like this: <?php if(running_on_hhvm()) { // do hhvm compatible routine } else { // do normal routine } 回答1: You can utilise the constant HHVM_VERSION specific to HHVM: if (defined('HHVM_VERSION')) { // Code } You can put this in your own function if you want. function is_hhvm() { return defined('HHVM_VERSION'); } if (is

Nginx PHP Failing with Large File Uploads (Over 6 GB)

孤街浪徒 提交于 2019-11-28 17:39:43
I am having a very weird issue uploading larges files over 6GB. My process works like this: Files are uploaded via Ajax to an php script. The PHP upload script takes the $_FILE and copies it over in chunks, as in this answer to a tmp location. The location of the file is stored in the db A cron script will upload the file to s3 at a later time, again using fopen functions and buffering to keep memory usage low My PHP(HHVM) and NGINX configuration both have their configuration set to allow up to 16GB of file, my test file is only 8GB. Here is the weird part, the ajax will ALWAYS time out. But