Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm currently trying to install the xhprof (PECL) extension onto my Mediatemple gridserver. I'm having a bit of a time of it since write restrictions won't allow the PECL installer to work. I've done the following:

mkdir /home/#####/data/lib/xhprof-0.9.2
uncompress into /home/#####/data/lib/xhprof-0.9.2
cd ./xhprof-0.9.2/extension/
make install
make test
mkdir /var/tmp/xhprof

The compiler seems to run fine. make test returns 8success, 0 failure.

then I'm adding the following to my php.ini (at /home/#####/etc):


Note that I don't have access to the global php.ini file.

At this point, xhprof still doesn't work (ie - a call to xhprof_enable() returns a fatal error - undefined function)

Other specs: PHP Version 5.2.14 Apache/2.0.54 My questiosn: What is the proper php-config path? How do I tell php to parse my additional php.ini file?

Am I doing anything else wrong?

Thanks in advance for any help..

share|improve this question

There is a nice guide on mediatemple wiki for setting up xhprof

Mediatemple has a hosting specific php.ini which you can use to setup.

share|improve this answer

I have met the same problem. But at last I solve it. This is because the Xhprof is not accurately loaded. If you run php -m which is used to show the extensions of PHP, you will find there is no Xhprof.

The steps which you install the xhprof is right, but maybe you chose a wrong php.ini file.

Maybe there are two files named php.ini, the one's location is /etc/php5/apache2/php.ini , and another's location is /etc/php5/cli/php.ini'. At first, some people may don't know where the php.ini is, so he write a file just named 'phpinfo.php' include a function 'phpinfo()' to find the location, and he enter the http://localhost/phpinfo.php at the broswer ,then glance over the page and find the 'Loaded Configuration File' is '/etc/php5/apache2/php.ini' ,so he add the [xhprof] into it.

But the '/etc/php5/apache2/php.ini' is for apache, and the '/etc/php5/cli/php.ini' is for client. So we should add the following to '/etc/php5/cli/php.ini' and just restart the apache.

share|improve this answer
Hi, nodejh and welcome to Server Fault. Apparently, you've undid my edits. The edits was mean to improve your post like: fix some typos and highlighting some important strings. See Why can people edit my posts? – masegaloeh Feb 2 '15 at 7:06
Hi,thank you for fixing typos for me! And I try to message you for thanks, but i dont no how to operate it -.- – nodejh Feb 2 '15 at 7:09

probably it wasnt loaded. Check using "php -m"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.