PDT XDebug. How to debug with ip address but not localhost - php

I am developing a PHP project and using PDT with XDebug which is working smoothly at localhost. (By the way, I am using XAMPP in windows 7)
Now, I want to debug some of the features from other PCs which need to use my local IP(or pc name) for request.
But I even can not debug at my local PC with IP address that is like http://127.0.0.1/xxx or http://192.168.1.yyy/xxx.
I have looked up some articles which introduced to change some settings in the php.ini and httpd.conf files. But there is no help to me (I have done some of them at the begining of I setting up the project and without problem to use localhost).

What I did is that first launch one browser (ie, ff, safari, etc.),
and enter the url I want to debug(of course there is no any response at this time)
Then I add ?XDEBUG_SESSION_START=ECLIPSE_DBGP just behind the url.
Secondly I launch another browser and enter the url I want to debug again,
but this time, you will have the PDT been going into debug mode.
Soruce: http://devzone.zend.com/1147/debugging-php-applications-with-xdebug/
by searching XDEBUG_SESSION_START which gave me the hint.

Related

Atom PHP Live Preview

I would like to achieve the impossible! After much research I simply can not get a live preview of a basic PHP website to work in my environment.
I have Windows 7/10 development machines and the first goal is to be able to make changes to PHP / CSS / SCSS files and see the changes appear automatically, on saving a document - without having to refresh the browser manually.
I'm using Atom v1.5, Wampserver v3.0.6 and have tried almost everything....LiveReLoad, BrowserSync etc etc.
The current setup works apart from live preview, in that I can display the websites and even go to different machines on the LAN and get to the website....but if I try and install Atom packages and or Chrome browser extensions, I generally get absolutely no response (i.e. no error message.)
Many thanks for anyone who can help with this - it surely must be a basic requirement for any professional developer?
Even though I've only just asked this question - I'd been working on it all day....however I have finally found a combination of tools and settings that worked!
The solution I found is:
Install Atom Live Server
Install Chrome Live Web Server Extension
Set the "Actual Server Address" in the Chrome Extension to whatever you have set in your Wampserver Alias - your httpd-hosts.conf file
Set the "Live Server Address" to your localhost + the port number gained from starting Atom Live Server: something like "http://127.0.0.1:4769"
Allow these requests through your firewalls on all applicable machines.
Note that Atom Live Server starts with a different port every time - so use the built in options to start on a fixed port, so that you don't have to keep changing the settings in the Chrome extension.
E.G. In Atom editor, ctrl-alt-5 to start it on port 5000

Xampp - Can see files through network but php, css, etc not working

I searched but couldn't find the answer to this specific question.
I'm running XAMPP for windows and it's working fine on my local machine but when I try to access Wordpress through the network all I get is the index page. The pages aren't formatted properly and the links don't work. PHP isn't working through the network.
This works on my local machine: "http://192.168.x.xxx/mysite/wordpress/" but when accessing it through the network, I get the problem above.
How can I get this to work so that someone in the next office can view the sites properly too?
The pages are not rendered properly because CSS is not being loaded. In wordpress setting (last tab on left), make sure you change the path to
192.168.x.xxx
By default, this path is localhost. Although they both mean the same thing, localhost is not interpreted the same as IP address. Like wise computer name is also not interpreted the same as localhost.
I would recommend to change localhost in wordpress setting to your computer name and then access your blog through your computer name, not the IP address, that makes life a little easier.
Also make sure you have shared the folder contain Wordpress + make sure your have enabled exception on firewall for port 80 which is the default port.
Have you tried looking here, there are looooooads of hits for this on google :
http://www.google.co.uk/search?gcx=c&sourceid=chrome&ie=UTF-8&q=xampp+not+working+over+lan
After a quick browse it appears the firewall on your pc is probably blocking it, as someone noted 'allowed port 80 limiting the scope to my subnet' , try allowing incoming traffic on port 80, restrict it to just your local lan though.
Just as a quick test try turning your firewall off totally and see if it works, if it does you know its a firewall problem and you will then need to open up ports its blocking.

How can I locally debug Facebook PHP applications?

I'm using Zend debugger and PDT for PHP development and have run into an issue debugging Facebook PHP. I'm using the example.php in the SDK to test. The application runs fine from Facebook, but I'm having trouble setting breakpoints. I have tried:
Run from Eclipse - Application does not run as expected. I'm getting null values for $_SERVER['HTTP_HOST'] and $_SERVER['REQUEST_URI'] although I can set breakpoints and debug.
Run from Facebook - the application runs as expected, but ignores breakpoints.
I'm using DynDNS for my DNS lookup and have changed my host file to redirect the URL to my local host.
I'm not even sure if #1 is possible, but it would be nice to use Eclipse and not have to refresh a web page as in #2. Any ideas?
Try defining a local domain for your local server in the hosts file of your OS (in Windows you can find it in C:\Windows\System32\drivers\etc).
For example, if your server runs on localhost, add the row:
local.mydomain.com 127.0.0.1
On the Facebook developers site (in your application settings), set the domain of the application to mydomain.com of local.mydomain.com and for the canvas URL (if you work within facebook canvas) set the local URL of your application.
For example:
Canvas URL: http://local.mydomain.com/my_application/index.php
Last, change the Debug URL of the specific page (in Eclipse's menu Run* → Debug Configuration) to the URL of the canvas (for example, http://apps.facebook.com/my_fb_app/).

installing wordpress on IIS using web platform installer

I have installed wordpress on my IIS server using web plaform intaller, everything is working fine when i am working on localhost.
when when i am trying to browse from external or another pc, the links are stayed http://localhost/page.php, which should be http://myserver/page.php
even the styling is not applied because of that.
how do I change the Path and make it work??
Thanks
You will have saved in the database that your site url was http://localhost. To access it from everywhere, I'd use your IP address instead, that way you should be able to see it on your local and external machines.
Do a quick export of your db, open in a text editor.
Find/ replace 'localhost' and change it to whatever your computer's IP is.
Import your changed sql file. Should be all good :)

Using PHP in VMWare and Eclispe on the host. I want to see the php-page in the Eclipse-Browser. How?

Following situ:
VMWare running on Win7
Debian, Apache, PHP and Squid running in VMWare
the website is located in the shared folder 'SF', so from
- debian-perspective: /mnt/hgfs/SF'
- windows-perspective: [...]/SF
my index.php is located in the sub-folder 'raffael'. So I am able to edit the website with Eclipse on Windows.
I can access index.php and properly execute it using Firefox and FoxyProxy through: http://raffael
My FoxyProxy-settings are:
IP: 192.168.0.128, Port:3128, Pattern: 'http://raffael*'
How do I have to configure Eclipse so that I can access the websie through the Eclipse-Browser instead of having to switch to Firefox all the time?
Thanks and happy new year!
Raffael
I don't think you need to make any changes to get the Eclipse browser to open a page; if another browser (such as firefox) can get to it, then so can your Eclipse browser. Just plug the same URL into your address bar and go.
Hope this helps.
You can tell Eclipse to use a proxy in Preferences -> General -> Network Connections. This is most likely a http proxy.
Could you explain why you need the http proxy? I do not immediately see a need to.

Categories