How to configure Xdebug for multiple users on a local machine? - linux

I have a new installation of Centos 7 running cPanel and WHM on an AWS EC2 instance. All software is the latest versions.
I used WHM to setup 5 users, which in turn creates linux users with their own home directory and their own public_html directories. Then I have enabled MATE Desktop and Tigervnc so each developer can connect to the machine in a vnc session.
So basically this setup is 5 linux users with their own apache vhosts, running their IDE on the same local server.
I then installed Xdebug using pecl and now I want to setup VSCode on each persons account to use Xdebug. I am also using opcache.
When trying to use VSCode, it seems like we can get the debugger to work, but there is no output in the console of VSCode. I installed the php-debugger extension in VSCode.
Also we seem to have a problem with VSCode not able to handle include/require statements. It always says that they cannot be found. But the files are indeed there and indeed have the correct permissions to be read/written.
I am not really sure how to configure Xdebug and VSCode to get them to work for all local developers with VSCode. Will what I am doing even work? Do I need remote connections? Do I need a DBGp proxy? Does Xdebug only allow one debugging session at a time? Do I need to install Xdebug for each user?
Can anyone provide some directions on how to set this up?
Thanks

Will what I am doing even work?
Likely :-)
Do I need remote connections?
On the Xdebug side, it does not matter whether it's "remote" or on the same machine, in both cases a TCP/IP connection is used. The "remote" in "remote debugger" was always a bad choice of words by the Xdebug developer (me).
Do I need a DBGp proxy?
You don't need it. What you need to be able to do is to have each user initiate a debugging session to their own IDE. As everything runs on the same machine, you can't just reuse ports. Xdebug always connects to the same configured port (9003 by default).
There are two alternatives:
Use a the DBGp proxy to direct incoming connections from the Xdebug port to registered IDEs. Each of these IDEs will have registered their key with the proxy, so the proxy knows where to forward the request to. You will need to use a browser extension so that each developer can set their own unique IDE key as the Xdebug session (cookie) value.
Use Xdebug Cloud, which would handle the complicated proxy set-up for you, and the developers only have to set their IDE Key (or now, Cloud key) through the browser extension again, as well as in their IDE. Only PhpStorm supports this for now. There is configuration documentation available.
Does Xdebug only allow one debugging session at a time?
No. Xdebug supports one debugging connection per PHP request, but IDEs might not accept more than one incoming connection. Both PhpStorm and VS Code's Debug Plugin don't have this problem.
Do I need to install Xdebug for each user?
No. Xdebug is installed as part of PHP, and as you've only got one PHP installation, having Xdebug available as part of the is enough.

Related

How to configure node and komodo ide?

i am trying to configure node.exe with komodo ide 10.2.
i have few asks :
Can i use Ctrl+s or other keys shortcut of the keyboard, to re-launch node interpreter to open/refresh the result of output in the web browser of a komdo's tab ?
For the moment i just did : Language -> Node.js->Default Node.js interpreter ->use this interpreter in this field i set c:\node.exe
Do I have to configure some others preferences fields?
Must i configure the field in Debugger ->Connection ->Komodo should listen for debugging connections on :->a specific port ? i set here 8080 ;
Must i check "I am running a debugger proxy and Komodo should use it"?
Must i configure a server in Servers and after configuer something in Mapped URIs??
or must i use a tool as supervisor with npm installer?
Komodo currently does not reload the browser preview when you save a file, you could use livereload to facilitate that.
The debugging port is only used when you use remote debugging, you do not need it for local debugging. You "must" not check anything, it depends on what you are doing. Most likely you do not need to use a debugger proxy for your use case.
You do not need to configure a server for debugging. Mapped URIs are useful if you are remote debugging, for local debugging you shouldn't need it.
I would suggest you read the Debugging Node documentation.

Netbeans 8.0.1 does not recognize that GlassFish 4.1 is running

On Linux (Gentoo) if I start GlassFish from Netbeans/Services area, the server will started, the admin site is reachable, but in Netbeans I get the following error message:
GlassFish Server 4.1 start failed.
Please check server admin user name and password properties.
Also please check the server log file for other possible causes.
and I can neither start again, nor terminate.
Any idea?
Well, I had the same situation but on Mac. After I updated to macOS Sierra. In my case was a block on the sites that use system proxy settings, where localhost, 127.0.0.1, are blocked.
Perhaps, your case es similar, but a proxy setting on you Linux (GENTO).
For mac this is the solution AppServer issues from Netbeans
Step 1: (Try to search for the same on Linux) Go to system preference >Network>Select your wifi connection>Advanced>select
proxies tab. There check 3 options 1) Auto proxy Discovery 2)Automatic
Proxy configuration 3) web proxy(http)
Step 2: Go to Netbeans>preferences>General> select use system proxy> reload> test connection You may get connection successful. If
connection gets successful, Now Clean & build your Applications in
netbeans and press run .
I hope this help you and give you an idea.

phpStorm to reload running node.js server

So, im running phpstorm with nodejs plugin that runs a server on local machine.
But i have to manually restart the server each time i change something. It would be very nice if it could automatically restart it, kind of like automatic deployment or just working with php.
Is there any way i could configure that?
Yes - you can try using Live Edit for this (you need to install the corresponding plugin from a repository). See http://blog.jetbrains.com/webstorm/2014/08/live-edit-updates-in-webstorm-9/

Linux: how to set up proxy using pac script

I am using Red Hat Enterprise Linux Server release 6.2, and I have only terminal access (no GUI). My company has a proxy auto-config script (PAC), and that is the only way to get internet connection.
I had no problem with my windows machine, since it was easy to set it up in IE->Tools->Internet Options. But in Linux, especially without a GUI, there seems to be no way to use this PAC script (I have been Googling for a while). By the way, the script is over 400 lines of Javascript.
Anyone knows how to solve this problem?
Proxy settings are implemented differently according to the software you use. On graphical desktop environments there are setup tools to configure a PAC; browsers like Chromium and Firefox detect the current desktop environment and import the proxy settings from there; Firefox also used to offer options for manual configuration of proxies and PAC URLs.
Integration of proxy options is not a priority for developers of text-only software packages. Each one of your tools will have to be manually configured to use a proxy. For example, APT must have a proxy configuration file at /etc/apt/apt.conf.d/.
Some packages may consult the environment variables http_proxy, https_proxy, et al, for proxy configuration.
You will need to read the documentation of the packages you will use in your GUI-less Linux to learn how to configure each of them to use the company's proxy. Some packages will use protocols and ports other than HTTP(S), FTP, GOPHER, which may be forbidden by the company's firewall.
I know this is an old thread.
In my case, I did the following steps
Download the automatic configuration script and copy proxy address from that file.
export "http_proxy" and "https_proxy" in bashrc using the proxy address get from step 1
Reload bashrc file
use the PAC even in the terminal environment. it works.

Chrome Native Messaging Host Access Rights

I am porting my NPAPI based plugin to Native messaging host for Chrome.
I can connect to it successfully and also run the host application.
But the host application (win32 GUI App) uses many win32 API's like CreateFile to update itself and other utilities from server.
The host app is installed in Program Files folder through an installer process (setup.exe). So since the host application runs on current user rights ( I may be wrong on this) the host might not have some rights (like in my case CreateFile) in the program files folder.
Through NPAPI it used to work as the executable i guess runs under System Rights (I may be wrong on this too).
So basically is there any way I can achieve this. I know this might be a security concern Chrome is trying to solve through Native Host, but I need to do this as otherwise some executable will not be updated from server.
Also the native host application requires some more files to be downloaded from server ( which i could not be placed in the installer).
Moreover, the source code to update the executables and download extra utilities is cross platform so I don't to change that, otherwise I might need to rewrite a lot of code.
So any suggestions to get around this situation ?
Is there some way we can get elevated permissions for the native host application through UAC or something. I don't mind if user is prompted for a UAC dialog.
Or are there any other alternative besides Native Messaging ? NaCl won't suffice either I guess.
Note : GetLastError() reutrns ERROR_ACCESS_DENIED during CreateFile.
Regards,
LazyCoder7.

Resources