I've just found and installed DevPHP 2.3.0 after using Maguma Open Studio for a long while (which is now defunct and very buggy).
I keep and edit my project files in a local folder, then copy to C:\Apache\htdocs for running and testing. So I have set up a new project with my local folder as root, and everything looks fine from an editing point of view (though I'm not too happy with having the project.prd file in the same folder, and there doesn't seem any way to add files to the project from a separate folder).
How can I set up to debug my project? I don't have php-cgi.exe (my php.exe runs as a service) and I don't understand why I need this, or how installing it would affect my current set up (I don't want to screw up my php.ini). Also it wants the path to xdebug, which doesn't appear to exist, although the installation says it's included.
Thanks for any help.
Progress so far: I got php-cgi.exe from php.net and copied it to the default C:\Program Files\Dev-PHP2\php\php-cgi.exe. Now I can run the Internal Preview, but after displaying any page I get the error "Error in my_thread_global_end(): 1 threads didn't exit". However I can continue from there ok, so not a big problem. It's also not displaying the source in the bottom pane, which I expected it to do. Presumably that's where you can set breakpoints when debugging.
General comments: The IDE looks great - I particularly like the integrated syntax checker. A debug feature is not such a big deal for me - I have got by up till now by putting in extra echo statements to find out what is happening when things go wrong (as they do, frequently :) ).
But it would be nice to have debug available, as long as it's not going to run too slowly.
> I'm not too happy with having the project.prd file in the same folder
These are only default options.
You can change the name and the path of project file.
Menu Project-> Save project...
> doesn't seem any way to add files to the project from a separate folder
One project -> one root folder...
... and as many subfolders as MS-Windows is allowing.
> How can I set up to debug my project?
> I don't have php-cgi.exe ... I don't understand why I need this
This php-cgi.exe is usually provided by the PHP installers (see below)
When internal preview is required, via <F5> or <Shift+F5>, the Dev-PHP's embedded internal web server needs to connect to a PHP engine. So just enter the pathname of this common gateway interface.
> I don't want to screw up my php.ini
Of course, so you just have to enter another php.ini (or a copy) of your own.
> Also it wants the path to xdebug, which doesn't appear to exist,
> although the installation says it's included
There were several installers :)
But, may I suggest using PiGii - lite version [ 4.83 MB ] ?
Download, then select only the PHP side for installing.
By the way, yesterday we released the stable version 184.108.40.2062 [ 1.3 MB ]
Thank you for your post. Any suggestion to improve the documentation is welcome.
> "Error in my_thread_global_end(): 1 threads didn't exit"
seems to be a PHP/MySQL issue
Could you check PiGii, lite version ?
> A debug feature is not such a big deal for me
Oh my God! Seriously ? :)
Xdebug is a fantastic tool.
As soon as possible, have a look to the "Context" tab.
> But it would be nice to have debug available,
> as long as it's not going to run too slowly.
I'm now waiting for your next post about that.
On arrive, mais...
"Cannot load Xdebug - it isn't thread safe, whereas Zend is"
I installed PiGii Lite to get this far. I have copied php-cgi.exe to the PHP-GTK.201 folder.
> On arrive, mais...
> I have copied php-cgi.exe to the PHP-GTK.201 folder.
That's exactly what shouldn't be done :-D
Because of PHP-GTK, we must use the NTS version. If you copy the php-cgi.exe from elsewhere, you've certainly got a TS (thread safe) version, hence the message. Back to PiGii ?
PiGii doesn't install php-cgi.exe, so where should I get a nts version from?
OK - I downloaded this: php-5.2.10-nts-Win32.zip, extracted php-cgi.exe from there and copied to PHP-GTK.201 folder. It seems to accept that ok bu now I get:
PHP Warning: PHP Startup: mysql: Unable to initialize module Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0
PHP Warning: PHP Startup: mysqli: Unable to initialize module Module compiled with module API=20060613, debug=0, thread-safety=1
PHP compiled with module API=20060613, debug=0, thread-safety=0 These options need to match in Unknown on line 0
I think I must have a conflict with my existing PHP installed as a service, running with my Apache server.
Sorry "lite" version doesn't include php-cgi.exe - that's a bug
"standard" and "huge" versions are ok.
Here it is http://devphp2.free.fr/files/php-cgi.exe
Oops no, I should have read it. It's MySQL that is thread safe and causing the conflict.
You're right. The MySQL driver should be NTS -
PiGii is supposed to install the right one.
Once again, sorry about the not included php-cgi.exe
btw, use the installed php-cli.ini (or a copy) it should work.
OK - now I've removed PiGii Lite and installed Standard. Standard includes both MySql and Xdebug - Lite includes neither, so is pretty useless for Dev-PHP!
I'll try again...
Well, it starts up without any errors now, on my start page, but hangs when I click the button to go to the next screen. Maybe a reboot will fix that. Also, there is still no source appearing in the lower panel.
And maybe in File Extension settings, the default should include .inc on the top line?
> hangs when I click the button to go to the next screen.
> Also, there is still no source appearing in the lower panel.
The sources are in the Editor panel.
To set breakpoints, click on the left part of the gutter.
The gutter is supposed to contain line numbers.
See menu "View->Line numbers"
You can use directly firefox with
I mean "index.php" or any other file needed to start the app.
The lower panel is "Messages".
It's mainly used via the debug toolbar.
About file extensions.
Actually, this form is mainly used to select the right highlighter.
Using extensions like .inc is not a good practice for security reasons
Because displaying the content of such a file is really easy.
Very often, these files are containing important parameters, one don't want to display.
Just rename it *.inc.php
A little more help needed, please!
I put a breakpoint at the start of the code of one of my files (client.php). Then in the internal preview window, I brought up the main menu of my program, which consists of buttons to start various functions. When I clicked on the button that goes to client.php, it did not hit the breakpoint, but carried on to display the client screen.
Am I doing something wrong here?
We have some explanations there:
Well, here are three methods to start a debug session:
1- Hit <Ctrl+F5> (Ctrl "controls" and F5 "executes") => debugger
2- Click on the lamp (first icon of the Debug toolbar)
3- From an external browser
. initialize the listener <Ctrl+F5> then <Ctrl+Break> (only once)
. enter http://localhost:8888/client.php?XDEBUG_SESSION_START=devphp
Afterwards, use the debug toolbar.
Hope this helps.
Thanks for that information.
Well, I still have some problems. For a start, localhost:8888 doesn't work ("Can't establish connection" - my Apache server is on port 80).
Also, I am running an application, not a single script. It seems odd that I have to set up Xdebug for each module I want to put a breakpoint in. In the client.php example, as I said above, if I put a breakpoint in there, then switch to the Internal Preview tab, it starts up in my initial login page (login.php). I then log in, arrive at the main menu (main.php), then click on the button that goes to client.php. It doesn't stop at the breakpoint. (Yes I activated it first).
Seems so complicated!
> For a start, localhost:8888 doesn't work ("Can't establish connection"
Dev-PHP is also a web-server (a basic one, limited - by design - to localhost).
By default, this server is listenning on port 8888.
Check also the port number which may be different from 8888
See Options»General options»Web server»Port
Since there's no default entry point you must enter one.
So, http://localhost:8888 has no meaning per se - although the error message should be different.
> my Apache server is on port 80
> Also, I am running an application, not a single script
As far as I know, technically we run single scripts, linked via a session-id.
> set up Xdebug for each module I want to put a breakpoint in.
If module means session, then Xdebug must be set up for each module
Because sessions are independent from each other.
> ... if I put a breakpoint in there, then switch to the Internal Preview...
This could be the problem. I mean that switching to Internal Preview prevents using the debug toolbar which controls execution.
Indeed, Internal preview is client-side, and the debugging is server-side.
> I then log in,
> arrive at the main menu (main.php),
> then click on the button that goes to client.php. It doesn't stop at the breakpoint.
> Seems so complicated!
In no case, I would say that it is obvious. But it's supposed to be as easy as possible.
I believe that I have to write a more detailed guide.
According to you, which tool should i use (I don't think that a wiki is the good one)?
Sorry if my terminology is confusing. By "module" I meant each individual php script that is run. I'm aware that they have to be linked via the session, which is why at the start of each script I have the lines:
When I call each "module", I pass the session identifier SID (which is empty if cookies are enabled), so in fact when the main menu runs client.php it does it through the button's onclick event, which expands to onclick='document.location.href=client.php?SID' (it's done through a function call, so what I wrote there is probably not syntactically correct).
So I am running a single session, and communicate between modules using session variables. That stuff all works OK.
When I click on the lightbulb in client.php, and click the 'run' icon (=F5), it says it's waiting for the server to run index.html (which has an immediate redirect to my initial php script). Then after a while it says done, but I don't see anything. If I switch to the local preview tab it briefly shows IE's "cannot display web page" error page, then quickly brings up the login screen as though it decided to start a new session.
I also tried playing with the port number: first I changed it to 80 and it said it couldn't bind because it was already in use. So I stopped my local Apache server and it bound ok. Then I tried to run and it sat there waiting. I started my local server again, which is when I got the IE error page (when I looked for it on the preview tab :) )..
I changed it back to 8080 (which is what it was set to originally), and here I lost track of what was happening. (I sort of gave up, in effect).
But never mind. I can manage without debug - its a small part, and I really like your IDE for its other features.
I don't want to take up too much more of your time - thank you for your help so far.
As for documentation, that's not my field, so I'm afraid I can't suggest a good tool to use. Another project I'm involved with uses WikkaWiki http://en.wikipedia.org/wiki/WikkaWiki
Well, from here I'm going to write a new chapter of the documentation. We're using MediaWiki, same tool as Wikipedia ;) Once this chapter will be written, could I ask you to review it ?
Yes, of course! I think we nearly wrote that chapter in this thread :)