diff --git a/plugins/php/conf/app_start.php b/plugins/php/conf/app_start.php
new file mode 100644
index 000000000..eb5c2c8e2
--- /dev/null
+++ b/plugins/php/conf/app_start.php
@@ -0,0 +1,49 @@
+save_run($xhprof_data, 'xhprof_foo');
+
+ $profiler_url = sprintf('http://0.0.0.0:5858/index.php?run=%s&source=xhprof_foo', $run_id);
+ echo "";
+ // echo 'Profiler output';
+
+}
+
+if (extension_loaded('xhprof')
+ && isset($_GET[XHProf_Name]) && $_GET[XHProf_Name] == 'ok' &&
+ (!in_array($_SERVER['SCRIPT_NAME'], array('/xhprof_html/callgraph.php',
+ '/xhprof_html/index.php')))) {
+ app_xhprof_start();
+ include_once $_SERVER['SCRIPT_FILENAME'];
+ app_xhprof_end();
+ exit;
+}
+
+?>