2

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
wget http://pecl.php.net/get/xhprof-0.9.2.tgz
uncompress into /home/#####/data/lib/xhprof-0.9.2
cd ./xhprof-0.9.2/extension/
phpize
./configure 
make
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):

[xhprof] extension=xhprof.so
xhprof.output_dir="/var/tmp/xhprof"

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..

1

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.

1

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.

  • 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
1

Had the same problem.

I am using PHP5.6 so i could easily install XhProf using the following:

apt-get install php5.6-xhprof

Try something similar to your version of php.

0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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