从给编译好的LAMP环境中的PHP添加Xdebug模块分析动态加载

1、在linux系统中有众多的.so文件放在modules目录下面,这里都是可以动态加载的模块,类似window系统中的dll文件(dynamic linked libaray),这里动态连接库只需要动态加载即可使用。

2、如果要加载新的模块,可以在PHP的配置文件中直接添加新模块的配置信息即可。

3、在linux上(其实在windows上也是一样的),在使用动态连接库文件的时候要注意版本对应和版本支持,相关信息可以到相关网站查看changlog。

4、xdebug的安装和说明

XDEBUG
------

You need to compile Xdebug separately from the rest of PHP.  Note, however,
that you need access to the scripts "phpize" and "php-config".  If your
system does not have "phpize" and "php-config", you will need to compile
and install PHP from a source tarball first, as these script are
by-products of the PHP compilation and installation processes. It is
important that the source version matches the installed version as there
are slight, but important, differences between PHP versions.

Once you have access to "phpize" and "php-config", do the following:

1. Unpack the tarball: tar -xzf xdebug-2.2.x.tgz.  Note that you do
not need to unpack the tarball inside the PHP source code tree.
Xdebug is compiled separately, all by itself, as stated above.

2. cd xdebug-2.2.x

3. Run phpize: phpize
   (or /path/to/phpize if phpize is not in your path).

4. ./configure --enable-xdebug (or: ../configure --enable-xdebug
   --with-php-config=/path/to/php-config if php-config is not in your
   path)

5. Run: make

6. cp modules/xdebug.so /to/wherever/you/want/it

7. add the following line to php.ini:
   zend_extension="/wherever/you/put/it/xdebug.so"

8. Restart your webserver.

9. Write a PHP page that calls "phpinfo();" Load it in a browser and
   look for the info on the xdebug module.  If you see it, you have been
   successful!


SUPPORT
-------

If you think that you encountered a bug, please file a detailed bugreport
at http://bugs.xdebug.org . You are required to create an account, this is
so that you can be contacted for additional information and to keep out
spam.


Derick Rethans
[email protected]

注意:只编译好,出现.so文件既可以正常使用了


总结:此模式适用于多种当前流行的软件扩展功能。


你可能感兴趣的:(PHP,Usage)