What's the Difference Between Extension and zend_extension in php.ini?

我们两清 提交于 2019-12-18 10:48:12

问题


When I installed Xdebug through pecl, it added the following line to my php.ini file.

extension="xdebug.so"

and everything I used worked. Until today.

Today I was having trouble setting up Xdebug for interactive debugging. I couldn't get anything working until I changed the above to

zend_extension="/usr/local/lib/php/extensions/xdebug.so"

(Caveat: I think this is what got me working, but I'm not 100% sure)

This raised the question in my mind. What's the difference in loading an extension via extension= vs. zend_extension?


回答1:


At the core of the PHP language (more like the interpreter, because a language is just a specification) is a software (interpreter, bytecode compiler) called "Zend Engine" developed by Zend.

Every module which messes with this core should be installed as a "zend_extension".

And yet, to solve your problem, ignore this attempt at explanation and consult the docs of the extension you're configuring - http://www.xdebug.org/docs/install.




回答2:


Zend_extentions are belong to the extensions those are build into zend engine itself. PHP that is built in zend engine itself. This engine parses, interprets and executes php script. If we change the engine it will change the way of PHP work.

Following message will describe the main difference between extention and zend_extension of php

Both extension kinds share lots of stuff. The difference between both types is mainly in hooks they register into the Engine. Remember that, despite it is very uncommon, an extension can be both a PHP extension and a Zend extension at the same time. Xdebug is a good example.

Find below image for main schema

For more detail refer this link



来源:https://stackoverflow.com/questions/1758014/whats-the-difference-between-extension-and-zend-extension-in-php-ini

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!