Coder Social home page Coder Social logo

Comments (10)

jtreminio avatar jtreminio commented on July 22, 2024

This is actually already implemented: https://github.com/puphpet/vagrant-puppet-lamp/blob/master/modules/php/manifests/custom/xhprof.pp

The only way to get xhprof working with php 5.4 is to compile it in. This does everything necessary... I've simply never actually used xhprof.

Once it's installed, what process should I follow to get it working?

from puphpet.

staabm avatar staabm commented on July 22, 2024

I prefer install xhprof over pecl, see e.g. http://queirozf.com/reminders/installing-xhprof-php-profiler-on-ubuntu

xhprof itself is just an profilling backend, so there is nothing more todo than install it over pecl and include/activate it via php.ini.

In case you also like to add a gui for it - which most people will probably need - you may also install http://xhprof.io/. To get it running you need to

  • create a database for persisting the data
  • define a database user
  • clone the gui into a vhost/document root
  • maybe create a dedicated vhost
  • adjust the PDO config within the GUI tool

But at first, the GUI is not needed IMO.

from puphpet.

frastel avatar frastel commented on July 22, 2024

Using pear xhprof will be installed in version 0.9.3 (just tested it on my 12.04 + PHP 5.4 machine). I think we should go this (out-of-the-box) way and not the manual installation way contained in the xhprof.pp.

from puphpet.

staabm avatar staabm commented on July 22, 2024

you mean pecl not pear?

from puphpet.

frastel avatar frastel commented on July 22, 2024

Oh of course. Had no coffee yet this morning :)

from puphpet.

staabm avatar staabm commented on July 22, 2024

you should fix that ☕ :-)

from puphpet.

jtreminio avatar jtreminio commented on July 22, 2024

Copy/paste this into a file:

<?php
$XHPROF_ROOT = "/var/www/xhprof";
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_lib.php";
include_once $XHPROF_ROOT . "/xhprof_lib/utils/xhprof_runs.php";
// start profiling
xhprof_enable();
for ($index = 0; $index < 1000; $index++) {
    $x = array(1,2,3,4);
    array_reverse($x);
 }
//end profiling 
$xhprof_data = xhprof_disable();
$xhprof_runs = new XHProfRuns_Default();
$run_id = $xhprof_runs->save_run($xhprof_data, "foobar");

Open the file in your browser, then go here: http://192.168.123.101/xhprof/xhprof_html/index.php?

Change out with your specific IP address.

from puphpet.

staabm avatar staabm commented on July 22, 2024

great, thanks

from puphpet.

frastel avatar frastel commented on July 22, 2024

Have to reopen. xhprof integration currently does not work an a nginx machine properly. Do not know yet where the problem is caused.

from puphpet.

frastel avatar frastel commented on July 22, 2024

php location for nginx is missing, so php pages are not interpreted.

from puphpet.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.