NetBeans and Zend Framework debug - debugging

I need to debug my Zend project with NetBeans but it's not work.
My configuration in php.ini:
; XDEBUG Extension
zend_extension = "c:/wamp/bin/php/php5.5.12/zend_ext/php_xdebug-2.2.5-5.5-vc11-x86_64.dll"
;
[xdebug]
xdebug.remote_enable = off
xdebug.profiler_enable = off
xdebug.profiler_enable_trigger = off
xdebug.profiler_output_name = cachegrind.out.%t.%p
xdebug.profiler_output_dir = "c:/wamp/tmp"
xdebug.show_local_vars=0
These also not work:
xdebug.remote_enable = on
xdebug.profiler_enable = on
xdebug.profiler_enable_trigger = on
{...}
Any suggestions?

There are two PHP Configuration files in WAMP Server
The first is used by the command line: C:\wamp64\bin\php\phpX.X.XX\php.ini
The second is used by Apache Server: C:\wamp64\bin\php\phpX.X.XX\phpForApache.ini
You need to make changes in the second configuration file which is used by Apache Server.

Related

Traefik Redirect Domain to Subdomain

I want to permanently redirect all requests to example.com and www.example.com to blog.example.com in a TLS environment.
My current config:
traefik.toml:
[entryPoints]
[entryPoints.web]
address = ":80"
[entryPoints.web.http.redirections.entryPoint]
to = "websecure"
scheme = "https"
[entryPoints.websecure]
address = ":443"
[providers.docker]
exposedbydefault = false
watch = true
network = "web"
[providers.file]
filename = "traefik_dynamic.toml"
[certificatesResolvers.lets-encrypt.acme]
email = "mymail#example.com"
storage = "/letsencrypt/acme.json"
[certificatesResolvers.lets-encrypt.acme.dnsChallenge]
provider = "myprovider"
traefik_dynamic.toml:
[http.middlewares]
[http.middlewares.goToBlog.redirectregex]
regex = "^https://(.*)example.com/(.*)"
replacement = "https://blog.example.com/$${2}"
permanent = true
[http.routers]
[http.routers.gotoblog]
rule = "Host(`example.com`) || Host(`www.example.com`)"
entrypoints = ["websecure"]
middlewares = ["goToBlog"]
service = "noop#internal"
[http.routers.gotoblog.tls]
certResolver = "lets-encrypt"
When I try to access example.com it gives my an SSL Protocol Error. All my other endpoints including blog.example.com are working. What am I doing wrong?
Okey, obviously it had nothing to do with my redirect configuration. Seemed like a hickup in traefik / docker, similar to ACME certificates timeout with traefik. Just waited one day and everything worked as expected. Just two minor updates to correct the redirect configuration. Maybe there's a more elegant solution.
traefik_dynamic.toml:
[http.middlewares]
[http.middlewares.goToBlog.redirectregex]
regex = "^https://(.*)example.com/(.*)"
replacement = "https://blog.example.com/${2}" # no double $$
permanent = true
[http.routers]
[http.routers.gotoblog]
rule = "Host(`example.com`, `www.example.com`)" # just an array of domains is fine, too
entrypoints = ["websecure"]
middlewares = ["goToBlog"]
service = "noop#internal"
[http.routers.gotoblog.tls]
certResolver = "lets-encrypt"

Gitlab-runner Interactive Web Terminals not connected

I have installed successfully a gitlab-runner on a VM, and it is used by some of my projects. I would like to use the Interactive Web Terminal to have a chance to debug when some pipeline fails.
I'm trying to configure my config.toml file, following this docu of GitLab but I'm not understanding which ip address I should use in the setting listen_address. Should it be the ip of the running machine? The docker container instance? Or what?
Here is my current configuration:
concurrent = 2
check_interval = 0
log_level = "panic"
[session_server]
listen_address = "0.0.0.0:8093" # listen on all available interfaces on port 8093
session_timeout = 1800
[[runners]]
name = "A test private repo"
url = "https://gitlab.com/"
token = "myToken"
executor = "docker"
[runners.custom_build_dir]
[runners.docker]
tls_verify = false
image = "alpine:latest"
privileged = false
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
[runners.cache]
[runners.cache.s3]
[runners.cache.gcs]
[runners.custom]
run_exec = ""
Screen of error I get
I noticed that when I hit the 0.0.0.0:8093 address on the machine where the gitlab-runner is running I get this response:
Your configuration should use:
[session_server]
session_timeout = 1800
listen_address = "0.0.0.0:8093"
advertise_address = "<your runner IP/hostname>:8093"
Should it be the ip of the running machine?
Yes

Traefik forward auth per frontend

I am trying to divide microservices and their auth.
Demo config is looks like:
[frontends]
[frontends.frontend1]
entryPoints = ["http"]
backend = "rancher1"
passHostHeader = true
forwardAuth = "http://127.0.0.1:8090"
[frontends.frontend1.routes.test_1]
rule = "PathPrefixStrip:/order"
[frontends.rancher2]
backend = "rancher2"
passHostHeader = true
[frontends.rancher2.routes.test_1]
rule = "PathPrefixStrip:/test"
How to apply forwardAuth to frontends.frontend1
Thanks to Daniel he helped me.
So, it's really easy to do:
Check your traefik version its should be at least 1.7 (i am not sure in which version this feature was added but its working in 1.7 and 1.7.1).
Make your config like this:
[frontends.service]
backend = "service"
passHostHeader = true
[frontends.ordersWorker.auth.forward]
address = "http://127.0.0.1:8090"

XAMPP, Xdebug and phpStorm

I'm having a heck of a time getting xdebug working on xampp. I'm trying to be able to debug php in the browser with phpStorm.
I'm on Windows 7 (64bit edition).
I downloaded the appropriate version of Xdebug (I think). PHP 5.4 VC9 TS (64 bit)
Put this in php.ini (the same php.ini from my phpinfo())
[XDebug]
zend_extension_ts = "\xampp\php\ext\php_xdebug-2.2.0RC1-5.4-vc9-x86_64.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable=on
xdebug.remote_host=127.0.0.1
xdebug.remote_port=9000
xdebug.remote_handler=”dbgp”
xdebug.trace_output_dir = "\xampp\tmp"
I had previous edited php.ini to change the default htdocs to another location (I am not sure if this would affect xdebug)
Also, I see the answer to many this kind of questions is to use the xdebug wizard. That's not working for me - doesn't tell me which binary to download for some reason.
Thanks #LazyOne
Made sure I had the 32-bit version (per this thread).
Made sure xdebug.remote_enable = 1
The following is working:
[XDebug]
zend_extension = "C:\Program Files (x86)\xampp\php\ext\php_xdebug-2.2.3-5.4-vc9.dll"
xdebug.profiler_append = 0
xdebug.profiler_enable = 1
xdebug.profiler_enable_trigger = 0
xdebug.profiler_output_dir = "C:\Program Files (x86)\xampp\tmp"
xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 1
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
xdebug.remote_port = 9000
xdebug.trace_output_dir = "C:\Program Files (x86)\xampp\tmp"

php.ini file for eclipse php debugging

I have been searching high and low and still cannot get debugging working with 'eclipse for PHP Developers 3.0.2'.
At the moment eclipse is just hanging at 57% with 'Launching: waiting for XDebug session. But while eclipse is hanging, the php file opens in an external browser and runs???
I'm using 'XAMPP 3.1.0.3.1.0' for the web server and have the appropriate 'php_xdebug.dll' file in the php ext folder.
I have tried numerous setting from other forums but still no luck, here is my php.ini file config for XDebug:
[XDebug]
zend_extension = "C:\xampp\php\ext\php_xdebug.dllstack"
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
;xdebug.profiler_output_dir = "\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
xdebug.remote_enable = 0n
xdebug.remote_handler = "dbgp"
xdebug.remote_host = "127.0.0.1"
;xdebug.trace_output_dir = "\xampp\tmp"
Anyone have an idea to what I need to change?
Seems like the configuration setting were not correct, good tool to use is http://xdebug.org/wizard.php.
Downloaded new version, added it the php/ext and updated php.ini:
[XDebug]
zend_extension = \xampp\php\ext\php_xdebug-2.2.2-5.4-vc9.dll
;zend_extension = "\xampp\php\ext\php_xdebug.dll"
;xdebug.profiler_append = 0
;xdebug.profiler_enable = 1
;xdebug.profiler_enable_trigger = 0
;xdebug.profiler_output_dir = "\xampp\tmp"
;xdebug.profiler_output_name = "cachegrind.out.%t-%s"
;xdebug.remote_enable = 0
;xdebug.remote_handler = "dbgp"
;xdebug.remote_host = "127.0.0.1"
;xdebug.trace_output_dir = "\xampp\tmp"

Resources