1: Download and install Xhprof
wget http://pecl.php.net/get/xhprof-0.9.3.tgz
Tar zxf xhprof-0.9.3.tgz
CD xhprof-0.9.3
CD extension
Phpize (execute this Code times wrong, cannot find autoconf. Please check your autoconf installation workaround See 5)
Which php-config (#找到 php-config path to this file)
./configure --with-php-config=/usr/bin/php-config #此处的地址就是上面你记录下来php address of-config
Make
Make install
2: Configure PHP.ini
php.ini file : You can update your php.ini file to automatically load your extension. Add the following to your php.ini file.
[Xhprof]
Extension=xhprof.so
;
; Directory used by default implementation of the Ixhprofruns
; Interface (namely, the Xhprofruns_default Class) for storing
; Xhprof runs.
;
Xhprof.output_dir=<directory_for_storing_xhprof_runs >
Ps:<directory_for_storing_xhprof_runs > This address is the directory used to hold the measurement records, and it will automatically come here to find the output file when the data is measured from the page output.
5: Install autoconf
Curl-o http://mirrors.kernel.org/gnu/m4/m4-1.4.13.tar.gz
TAR-XZVF m4-1.4.13.tar.gz
CD m4-1.4.13
./configure–prefix=/usr/local
Make
sudo make install
Cd..
Curl-o http://mirrors.kernel.org/gnu/autoconf/autoconf-2.65.tar.gz
TAR-XZVF autoconf-2.65.tar.gz
CD autoconf-2.65
./configure–prefix=/usr/local
Make
sudo make install
After installing autoconf, proceed to step 1.
The final installation is successful, but there is no xhprof in Phpinfo, I think the version of the extension is wrong, and PHP 5.6.3 conflict
Configure Xhprof under Mac