Netbeans php Xdebug Socket Exception with Joomla debugging - php

My system
PHP Version 5.4.0-1build1~ppa1~oneiric
Xdebug v2.2.0rc1, Copyright (c) 2002-2012, by Derick Rethans
Apache/2.2.20 (Ubuntu)
When I debug a Joomla up, coming near to the error that I wish to spot on, debugger breaks and gives me Socket Exception problem, with follownig stack trace.
Please help me, I am going crazy.
I was not able to downgrade xdebug, and I have tried on my machine with - another browser,
- another Java build,
- a new userdir for netbeans ( deleting completely the older one ,
- recreating the project putting also the netbeans directory under another path ( this because I needed to put files under www-data properties)
INFO [org.netbeans.modules.php.dbgp.DebugSession]
java.net.SocketException: Pipe interrotta
at java.net.SocketOutputStream.socketWrite0(Native Method)
at java.net.SocketOutputStream.socketWrite(SocketOutputStream.java:109)
at java.net.SocketOutputStream.write(SocketOutputStream.java:141)
at org.netbeans.modules.php.dbgp.packets.DbgpCommand.send(DbgpCommand.java:90)
at org.netbeans.modules.php.dbgp.DebugSession.sendCommands(DebugSession.java:211)
[catch] at org.netbeans.modules.php.dbgp.DebugSession.run(DebugSession.java:143)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

There were a few bugs in the Xdebug 2.2.0RC1 release with debugging. Those should all be fixed with yesterday's release of Xdebug 2.2.0. If you can still reproduce it, please file bug reports at http://bugs.xdebug.org.

I have tried all following:
- remove all watches ( ooops I did not have any one ! )
- use a new fresh userdir with netbeans but nothing
- upgrade xdebug to 2.2.0
- downgrade php version to 5.3.10 ( but I was not able )
- reinstall completely apache and LAMP ( but some configuration were not completely deleted, so if you want to do it, be sure of purging and configuration file of apache or php related )
At the end I did a fresh ubuntu installation, and now it works fine.
Hope error log in xdebug can improve to take in account and solve this kind of error without uninstalling all!

Related

PhpStorm: Failed to parse validation script output PHP version not installed Debugger not Installed

I'm on Windows 10 x64 and today I wanted to install a new version of XAMPP. What I did was to uninstall my current one and then remove PHP from the environment variables. After that, I downloaded XAMPP as usual and installed it along with Xdebug, the same way that has worked for me during the past two years.
When I opened PhpStorm and went to set the CLI interpreter I noticed that it said "PHP version: Not installed" and "Debugger: Not installed" (although I have the PHP executable set to C:\xampp\php\php.exe).
What I did after that was to try reinstalling PhpStorm, both with my current settings and then other settings. It didn't help.
Upon checking the PHP version in the command line it does say that I have the new version installed. I am also able to do a simple echo 'hello'; and have it printed in the browser on my localhost. I'm not sure what to make of that. However, debugging inside PhpStorm does not work despite seeing on my PHPinfo that Xdebug is installed.
After googling around I don't see much that is relevant to what I'm doing. It seems like everyone who faces this issue is using a remote interpreter and a mac.
Does someone know what to do about it with my settings or have any suggestions on how to get this solved?
Setup:
Windows 10 Version 1903 for 64
xampp-windows-x64-7.4.1-0-VC15-installer
PhpStorm 2019.3.1
PHP 7.4.1
Zend Engine v3.4.0, with Xdebug v2.9.0
Error message:
Failed to parse validation script output
In my case Comodo Internet Security (CIS) was adding php.exe to blocked applications.
Unblocking it fixed the issue.
My config:
PHP 7.4.5 64 NTS
Windows 10 1909
PhpStorm 2020.1

How do I upgrade PHP version in macOS Server?

Good day,
Just to clarify, I'm asking about macOS Server, the application published by Apple. I'm not referring to the system's PHP version.
I've looked everywhere, Google, SO, forums, for quite some time and haven't found a solution.
I'm unable to upgrade my PHP version for macOS Server no matter what I try. There's just simply no documentation.
I've updated the app from the App Store, I've upgraded my PHP version on my Mac, and I've changed the PATH to reflect the new PHP install, and when I do php -v in Terminal, it shows the correct version I want.
However, macOS Server seems complete unaffected by it. I tried looking around everywhere possible, but I don't see a separate install of PHP for Server, and I looked in the config files, everywhere, but can't see where and which PHP it's using.
Any help?
EDIT: I just realised that it's a whole application which many parts actively use PHP, and upgrading it on my own may break those things, but I'm willing to give it a shot, if it's at all possible. I mean, the worst that can happen is for me to delete and re-install Server, right?
Installing php on macOS
Honestly, you sound like you know more about this than is evident in the question. So you probably know a lot of this, but I wanted to be as complete as I can, from my experience, since these responses remain for others who may locate them in the future and find the information useful. If I have left anything out, I hope someone will point it out for me so I can learn a bit more along the way.
Back in the day, then thunder gods ruled the world:
php has come bundled standard on Macs since Mac OS X version 10.0.0, as you can read about here. The first version of Mac OS X Server (1.0) was a hybrid of OPENSTEP from Steve Jobs' NeXT Computer and Mac OS 8.5.1 released in 1999.
Starting with Mac OS X 10.7 (Lion) Mac OS X and Mac OS X Server have been combined into one operating system package and the macOS Server is an add-on package available through the App Store. This means that you can't really worry very much about ruining anything too important.
You can't always get what you want ...
A lot of the value in this response will depend on what you use the Server package for. If you only use the web server for a development environment, it can easily be replaced with any version of the typical LAMP (linux-apache-mysql-php) style environment.
For macOS, this means upgrade apache, install php, and install MySQL if you cannot use SQLite that comes bundled with macOS. Here is one of the many great tutorials available online. (no affiliation) It can get complicated ...
Another option that is popular, but that I haven't used myself, is the non-profit XAMPP. They are focused on making it simpler to setup php development, Wordpress, Drupal, e-commerce, and popular open source apps.
When you're a stranger ...
If you are using some of the more esoteric apps that came with the server package, you will have to upgrade them separately. But since you are asking about php and the server recognizing it, I'm assuming you are talking about the web server and that you are using something like this to see what php version apache is finding:
<?php phpinfo(); ?>
Most likely, what you are saying is that the command line php version shows correct versions and settings, but the web page version served by apache shows the old version. Is that right?
Version and File Locations:
I'm not sure if you have checked for this, but the first thing I would do is find out for sure what the path is and what version I am using. This also gives me a quick direct link to the ini file so I can go break stuff faster. Here are my results (screenshot at the end) using php --version and php --ini:
$ which php
/usr/local/bin/php
$ php --version
PHP 7.3.6 (cli) (built: May 31 2019 23:38:25) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies
with Xdebug v2.7.0, Copyright (c) 2002-2019, by Derick Rethans
with Zend OPcache v7.3.6, Copyright (c) 1999-2018, by Zend Technologies
$ php --ini
Configuration File (php.ini) Path: /usr/local/etc/php/7.3
Loaded Configuration File: /usr/local/etc/php/7.3/php.ini
Scan for additional .ini files in: /usr/local/etc/php/7.3/conf.d
Additional .ini files parsed: /usr/local/etc/php/7.3/conf.d/ext-opcache.ini
A touch too much:
Using php -i will output an enormous amount of information. It is many pages ... more than you would ever want. If you are looking for specifics, you can grep it for whatever you like: php -i | grep ini or php -i | grep -- '--with' to look for options.
Hiding in plain sight:
Most likely you are checking, testing, and upgrading the wrong installation of php or apache. macOS is infamous for having standard versions of many programs and it will likely break something if you upgrade the 'system' version of any of them.
Ruby and Python are the most common ones to cause problems for me. I have never had any issue with php, but there and many workarounds available for many programs (e.g. coreutils for gnu).
Homebrew!
The easiest way I have found is to use Homebrew to install a separate version that you can manage and upgrade as you like and link it somewhere early in your path so it is always the first version found.
$ brew install php
It does everything for you and keeps it updated. It also allows php to always be running as a service using brew services start php. This reduces startup time and prevents some multiple version issues. A list of all brew services and status info is, as you might expect, found with brew services list. If you update any config or ini files, you should restart php (and apache) with brew services restart php. You can also still use launchctl and apachectl if you choose.
Apache!
The other handy thing about homebrew is that you can use it to install and manage apache2, also. Try this:
$ brew install httpd
$ brew services start httpd
$ httpd
Non-alcoholic recipe:
If you prefer to abstain and not use homebrew, you can install any version you wish from php.net and make a link in a directory early in your PATH. Patches and upgrades are regular and everything is extremely professional and well (over?) documented.
Download a php binary, check it with the provided signatures, and link it somewhere on your path: ln -s /path/to/new/php ~/bin/php or somewhere else if you don't use your /home/bin. Homebrew puts the link in /usr/local/bin by default.
No matter which method you choose, after you install the programs you will definitely have to adjust a few settings. There are several great posts online about this. This one is a multi-part series and is updated for Mojave. The main information to get you started should be available as shown in the screenshot below.

Segmentation fault with Homebrew php56-xdebug

I've been running PHP 5.4 with xdebug on my Mac via Homebrew for a while, and yesterday I tried to upgrade to 5.6 with xdebug using the php56 and php56-xdebug formulas. I was able to get php56 working fine, but as soon as I install the php56-xdebug formula, Apache won't load, and I get a segmentation fault. If I remove php56-xdebug, everything works fine again. My php error log was showing that xdebug.so was trying to load twice, but I uninstalled everything php 5.4 (php54, php54-xdebug, etc.), so that went away. But for some reason, I can't get rid of my "Segmentation fault (11)" error message. I've triple checked my apache config settings and my xdebug.ini, and they are correct, as they always have been. I'm also not getting any errors in my PHP error log.
I've tried uninstalling php 5.6 itself, as well as the xdebug formula, all to no avail. Short of re-installing my OS, what do I need to do to get xdebug working?
Thanks.
Update: Per this issue, I installed php56-xdebug using --build-from-source, but the result is the same.
It looks like the problem was issues in the 2.3.x branch of xdebug. I ended up manually compiling xdebug 2.2.7 and got it to work that way.

Install or use php composer in windows (fails)

so basically i was using composer on my windows installation without any problems. Suddenly i get this error on every project (installing composer.phar manually):
[RuntimeException]
Could not rename "Xampp\htdocs\symfony.dev\vendor/twig/twig/fabpot-Twig-
70fff8b" to "Users\xxx\AppData\Local\Temp/23cd0cd163431d8305983511f9
b1c2af".
I tried installing or updating on different php apps. Always the same result.
Also i tried to install composer via the windows setup which leads me to this error message:
Internal Error [ERR_LOGIC]: An internal script did not run correctly (exit code 1)
So far i couldn't get any official help. Anybody else experienced this error? Your help is appreciated... thanks a lot in advance!
When you run any command or start cmd. You have recived:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
The system cannot find the path specified.
If have, Try the following.
Open the Registry Editor, type regedit and hit Enter
Navigate to HKEY_CURRENT_USER\Software\Microsoft\Command Processor\AutoRun
and clear the values.

PHP 5.3.5 With Zend Debugger

I am trying to get the zend debugger to work but till now I have failed. I have searched everywhere and tried everything I found but still not working.
I am using windows 7 64 bit with Zend studio professional edition 8.0. I have vmware installed on windows and have an opensuse 11.4 64 bit server setup. it is installed in minimal so i dont have gui just commands. On open suse i have php 5.3.5, apache 2.2.17 and mysql installed. I also installed Zend Debugger 5.3.X which I downloaded from zend's website. I've put the ZendDebugger.so file into /usr/lib64/php5/extensions/
I inserted the following in the php.ini for debugger
[Zend]
zend_extension="/usr/lib64/php5/extensions/ZendDebugger.so"
zend_debugger.allow_hosts= 127.0.0.1, 192.168.4.70
zend_debugger.expose_remotely=always
in phpinfo(), zend debugger is not loading
anyone know what I am doing wrongly here or any suggestions i should try?
Thank you
UPDATE!!
Since I have not managed to get this thing working with my setup could anyone of you tell me if I can use XDebug with my setup i.e. Zend studio 8 + Apache + XDebug?
So finally after trying everything I found the solution for the problem.
I had a missing file in linux so zend debugger wasnt working. To find what was the problem I used the following command in linux
PHP -m
This shows all the modules that are installed on the OS and if there are any problems it will tell you what the problems are. I got an error message of missing libssl.so 0.9.8. Opened yast -> software management types SSL and installed the 0.9.8 and everything is fine now.
Zend studio 8 and 9 are not compatible with xdebug since the Zend studio team developers do not test that XDebug works in their IDE as we speak. Read more here:
http://forums.zend.com/viewtopic.php?f=59&t=24113
My conclusion is that Eclipse Indigo with PDT is the best solution out there for the moment until the Zend developers solve this.
Looks like you've followed the instructions to the letter with the exception of the multiple IP addresses.
The manual states they should be separated by commas. Try changing it to
zend_debugger.allow_hosts=127.0.0.1,192.168.4.70
Have you restarted Apache since installing the debugger?

Categories