Composer with XDEBUG - PHP

3

I have XDEBUG installed on my PHP . In this scenario, when composer installation is done, I get an error message about runtime performance, according to the picture below:

Myquestioniswhatisthescopeofthisperformancedrop?Itwouldonlybeincomposerexecution,whenI'mdownloadingandinstallingdependenciesorrunningPHP(whichwouldbethemostseriouscase)?

Hereatthe composer site we have the instruction to disable the < in> xdebug , but it is not very clear whether it will be something permanent.

Has anyone ever had this problem?

    
asked by anonymous 18.06.2016 / 21:55

1 answer

1

XDebug is not installed (enabled) in Composer and yes in PHP, there are two basic layers of php usage, the web (which can use several types of modules) and the CLI (command line), in case the XDebug will only be useful to you in the module with Apache (like PHP-FPM, Apache2handler or Fast-cgi) in the composer it is totally expendable.

XDebug is a tool for development, that is, the composer is not necessarily development, it is a package manager, development will happen after installing the packages.

This message that appears is only an explanation that performance can be affected in PHP executions, usually every installation via composer depending on the package or application will take longer, but you may not even feel it, that is, it varies from package for package.

In case you are using Xampp then the configuration files are:

  • c:\xamp\apache\bin\php.ini used for Apache, ie the settings will be valid when accessing http://localhost/

Then open and edit c:\xampp\php\php.ini using SublimeText or Notepad ++, do not use Windows notepad.exe (known as Notepad) because it does not recognize line breaks, look for a line similar to:

zend_extension_ts="C:/xampp/php/ext/php_xdebug.dll"

or (very unlikely):

extension="C:/xampp/php/ext/php_xdebug.dll"

And comment on it by adding php script.php to the beginning:

;zend_extension_ts="C:/xampp/php/ext/php_xdebug.dll"

Note that this is an example, if you do not find it, use Ctrl + F in your text editor (sublimetext or notepad ++) and type c:\xampp\php\php.ini , search until you find ; .

As I said XDebug is of no use to xdebug , XDebug is only used the moment you are writing your files.

If it is not Xampp

It may happen that you are using another php + apache installation facilitator, in this case it may be that php.ini for CLI and for Apache are the same, in which case you can configure Apache to load a different php.ini , in case you copy your .dll file that is in the PHP installation folder to a different folder, preferably the apache folder (assuming it is composer ) and then edit the file named httpd.conf with sublimetext or notepad ++ (or another similar editor) and look for a line like this php.ini , if its value is different from the location of the php installation is because there is already a php.ini only for apache and this process is not possible, but if something is as C:\apache\ or PHPIniDir then change the value to point to the new php.ini, for example:

PHPIniDir "C:/apache/"

In this way you will have a php.ini only for apache and another only for PHP in CLI / CGI mode, as I said in php.ini for apache you can enable XDebug and in php.ini that is in the same folder that php.exe you should disable XDebug with the examples I mentioned earlier.

Installed via repository (linux or like-unix)

In systems like linux sometimes the installation of PHP and Apache are done via repository and usually there will already be a php.ini for CLI and another one for Apache, the path is usually C:\php\ , but there are times that the local is different, for this you can search using the following command in the terminal:

$ php -i |grep php\.ini

Source: link

Or if you need more details:

$ php --ini

Source: link

Then open the file with your text editor (eg vim, gpedit, leafpad, etc.) and look for a line that contains something like this:

zend_extension="ext/php_xdebug.so"

Or this:

extension="ext/php_xdebug.so"

And comment on it by adding C:\wamp\php\ at the beginning, getting something like this:

;zend_extension="ext/php_xdebug.so"

Conclusion

Now, Xdebug will be disabled for the composer, since it really is something that is not necessary, please note that although using Xdebug next to PHP with Apache, it should only be used for development, on your production server (when you put the website in the air for people to use) you should always leave XDebug disabled on the online server (ie outside your machine), this is because it does not serve much on the server production still consumes greatly affecting performance.

    
19.06.2016 / 02:59