Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » PDT, Wampserver and non-executed mysql-functions
PDT, Wampserver and non-executed mysql-functions [message #39853] Mon, 30 July 2007 21:06 Go to next message
Eclipse UserFriend
Originally posted by: hamena314.freenet.de

Hi,
I use Eclipse 3.3 with the PDT-Plugin 1.0.0 on a Windows XP Pro
Platform. Also Wampserver 1.6.6 with PHP 5.2, Apache 2.0.59 and MySQL
5.0.27.
I imported a project into Eclipse and tried to debug, but get an error.
Whenever "Debug as PHP-Script" is started, the Debugger refuses to
exectue MySQL-functions, special not the "mysql_connect()" function.
The console prints:

Debug Error: file.php line 10 - Call to undefined function mysql_connect()

My testfile looks like this:

<?php
$msg = "This is a message";
$aThings = array('one', 'two', 'three');
foreach ($aThings as $value) {
print $msg . ' - ' . $value . ' ';
}
$dbuser = 'xyz';
$dbpasswd = 'abc123';

$dbconnect = mysql_connect("localhost",$dbuser,$dbpasswd) or die();
?>

It stops at the breakpoint, shows the var's correctly but stops at the
mysql_connect.
I read that this seems to be a debugger-problem and I should check if
the mysql-dll is there.
Well, it is but the debug-process is not working.

All ideas welcome!

Marcus
Re: PDT, Wampserver and non-executed mysql-functions [message #39883 is a reply to message #39853] Tue, 31 July 2007 05:44 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mep_eisen.web.de

That's not PDT specific.

Seems You are missing mysql extension while debugging. Try to locate your
PHP.INI and copy it to a location php should find it or try to update your
debugger settings. AFAIK there is a possibility to insert the correct path.

command line options:
php -c <path-to-your-php-ini>
Re: PDT, Wampserver and non-executed mysql-functions [message #39916 is a reply to message #39853] Tue, 31 July 2007 05:48 Go to previous messageGo to next message
Michael Spector is currently offline Michael SpectorFriend
Messages: 110
Registered: July 2009
Senior Member

Zend Debugger has such a limitation - it cannot work on script that contains fatal errors (like: undefined function).
The question is: whether it's important to allow partial debugging of correct pieces in the code?

On Mon, 30 Jul 2007 23:06:37 +0200
Marcus Wobig <hamena314@freenet.de> wrote:

> Hi,
> I use Eclipse 3.3 with the PDT-Plugin 1.0.0 on a Windows XP Pro
> Platform. Also Wampserver 1.6.6 with PHP 5.2, Apache 2.0.59 and MySQL
> 5.0.27.
> I imported a project into Eclipse and tried to debug, but get an error.
> Whenever "Debug as PHP-Script" is started, the Debugger refuses to
> exectue MySQL-functions, special not the "mysql_connect()" function.
> The console prints:
>
> Debug Error: file.php line 10 - Call to undefined function mysql_connect()
>
> My testfile looks like this:
>
> <?php
> $msg = "This is a message";
> $aThings = array('one', 'two', 'three');
> foreach ($aThings as $value) {
> print $msg . ' - ' . $value . ' ';
> }
> $dbuser = 'xyz';
> $dbpasswd = 'abc123';
>
> $dbconnect = mysql_connect("localhost",$dbuser,$dbpasswd) or die();
> ?>
>
> It stops at the breakpoint, shows the var's correctly but stops at the
> mysql_connect.
> I read that this seems to be a debugger-problem and I should check if
> the mysql-dll is there.
> Well, it is but the debug-process is not working.


--
Michael
Re: PDT, Wampserver and non-executed mysql-functions [message #39978 is a reply to message #39883] Tue, 31 July 2007 08:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hamena314.freenet.de

Martin Eisengardt schrieb:
> That's not PDT specific.
>
> Seems You are missing mysql extension while debugging. Try to locate
> your PHP.INI and copy it to a location php should find it or try to
> update your debugger settings. AFAIK there is a possibility to insert
> the correct path.
>
> command line options:
> php -c <path-to-your-php-ini>
>

I located my php.ini in the correct path.
C:\wamp\Apache2\bin\php.ini

The extensions are also loaded and in the php-ext directory:
php.ini:
extension=php_mysql.dll
extension=php_mysqli.dll
....
[Zend]
zend_extension_ts = "C:/wamp/php/ext/ZendDebugger.dll
zend_debugger.allow_hosts = 127.0.0.1/32
zend_debugger.expose_remotely = always

C:\wamp\php\ext\ZendDebugger.dll

When I try to do the "php -c <path-to-my-php-ini>", my command-prompt
simply stalls. Nothing happens for several minutes, so I have to stop
it, since I think this command should take this long time (e.g. 10
minutes and more).

Phpinfo() also states, that I have the ZendDebugger up and running:
"with Zend Debugger v5.2.3, Copyright (c) 1999-2006, by Zend Technologies"
Both - mysql and zend - are also to find in the phpinfo() with
informations, which means they are implemented and running.

I have no idea what to do now...

Marcus
Re: PDT, Wampserver and non-executed mysql-functions [message #40102 is a reply to message #39978] Tue, 31 July 2007 11:59 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mep_eisen.web.de

> When I try to do the "php -c <path-to-my-php-ini>", my command-prompt
> simply stalls. Nothing happens for several minutes, so I have to stop
> it, since I think this command should take this long time (e.g. 10
> minutes and more).
Working as expected since php wait for any input. ;-)

> Phpinfo() also states, that I have the ZendDebugger up and running:
> "with Zend Debugger v5.2.3, Copyright (c) 1999-2006, by Zend Technologies"
> Both - mysql and zend - are also to find in the phpinfo() with
> informations, which means they are implemented and running.
Did you try to run a phpinfo() via debugger/eclipse? I bet there is no
info about mysql extension because it does not load it.

If Eclipse does stop at your breakpoints but reports undefined function
"mysql_connect" this is a configuration problem. I got some similar
problem on my laptop@home. It simply did not found the correct php.ini. In
some hours I will be able to tell You about this. There are some options
to configure pdt so that Your php executable uses the correct php.ini.
Re: PDT, Wampserver and non-executed mysql-functions [message #40192 is a reply to message #40102] Tue, 31 July 2007 15:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hamena314.freenet.de

> Did you try to run a phpinfo() via debugger/eclipse? I bet there is no
> info about mysql extension because it does not load it.
>
> If Eclipse does stop at your breakpoints but reports undefined function
> "mysql_connect" this is a configuration problem. I got some similar
> problem on my laptop@home. It simply did not found the correct php.ini.
> In some hours I will be able to tell You about this. There are some
> options to configure pdt so that Your php executable uses the correct
> php.ini.

Well, finally making some progress.
Yes, when I debug a phpinfo()-file, I can see the loaded Zend-Debugger,
but the mysql extension is missing!
If you have the solution for this I would like to read it.

Thanks for your help!

Marcus
Re: PDT, Wampserver and non-executed mysql-functions [message #40326 is a reply to message #40192] Wed, 01 August 2007 10:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mep_eisen.web.de

I am using XDebug. Somehow its easy to set configuration file within this
plugin.

I played around with pdt (zend debugger). Maybe You are using relative
directories? Have a look at your php.ini located near your php.exe
There should be some entry called "extension_dir". At default this simply
points to "./" or "./ext". PDT copies this file to your profile directory
and inserts some useful things ("C:\profiles\<user>\temporary files\temp"
or similar. I am using some german winxp translation *g*). Try to have a
look at this to decide if its useful. However you will need to insert some
abolute path at your original php.ini. f.e.
extension_dir="C:\Programs\php5.2.3\ext"

After editing this pdt will use the new php.ini and php itself will find
the correct extension dlls. Hoping this solution works for You. :-)
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #40356 is a reply to message #40326] Wed, 01 August 2007 12:00 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hamena314.freenet.de

Martin Eisengardt schrieb:
> I am using XDebug. Somehow its easy to set configuration file within
> this plugin.
>
> I played around with pdt (zend debugger). Maybe You are using relative
> directories? Have a look at your php.ini located near your php.exe
> There should be some entry called "extension_dir". At default this
> simply points to "./" or "./ext". PDT copies this file to your profile
> directory and inserts some useful things ("C:\profiles\<user>\temporary
> files\temp" or similar. I am using some german winxp translation *g*).
> Try to have a look at this to decide if its useful. However you will
> need to insert some abolute path at your original php.ini. f.e.
> extension_dir="C:\Programs\php5.2.3\ext"
>
> After editing this pdt will use the new php.ini and php itself will find
> the correct extension dlls. Hoping this solution works for You. :-)

No, I was not using relative paths, also there were some confused
slashes, which I copied from Configuration-Sites for PDT.
In my php.ini some entries used a format like this:
extension_dir="C:\wamp\php\ext"

but others, namely the copied entries for the Zend extension used this:

zend_extension_ts = "c:/wamp/php/ext/ZendDebugger.dll

So I started playing around with the entries, until I saw in the
phpinfo() in Eclipse, that the directories for /ext and php.ini itself
were totally different to what was written in the configuration i.e.:
Path to php.ini = "C:\WINDOWS\". Also at C:\WINDOWS existed no php.ini!
I checked all the other entries and finally looked at the path to the
php.exe, which stood as "C:\php5". Again, at C:\php5 existed no
directory at all and no php.exe!
I figured out, the plugin had a completely own php.ini!

At
C:\Eclipse_3.3\plugins\org.zend.php.debug.debugger.win32.x86 _5.2.6.v20070507\resources\php5
is a directory with a php.exe and a php.ini. THE one, which the Zend
Debugger uses.
In it was written only:
zend_extension_ts=.\ZendDebugger.dll

So I added the other needed extensions:
; Directory in which the loadable extensions (modules) reside.
extension_dir = "C:\wamp\php\ext"
extension=php_mysql.dll
zend_extension_ts=.\ZendDebugger.dll

Now everything is working as expected and the mysql-functions are there.
I'm thinking about copying the php.ini from C:\wamp\Apache2\bin to the
Eclipse-php.ini in order to get all extensions loaded.
This is also a way, to get different configurations ready pretty easy
and use wampserver or xampp in no time.

Thanks for your help, I'm very happy!

Greetz, Marcus
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #40471 is a reply to message #40356] Thu, 02 August 2007 07:30 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: mep_eisen.web.de

Did you insert the correct path to your own php.exe inside eclipse
configuration? Window->Preferences->PHP->Executables
For me it does not use the internal php.exe.
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #41099 is a reply to message #40471] Sun, 05 August 2007 19:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: hamena314.freenet.de

Martin Eisengardt schrieb:
> Did you insert the correct path to your own php.exe inside eclipse
> configuration? Window->Preferences->PHP->Executables
> For me it does not use the internal php.exe.

I am using the PDT php.exe and it is correctly entered in the Preferences.
Did you try to delete all settings in the Executables-Tab, enter it
again and start Eclipse with the -clean option?

Greetz
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #52311 is a reply to message #40356] Mon, 17 September 2007 18:13 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: acdc.and.me.gmail.com

Marcus Wobig schreef:
> Martin Eisengardt schrieb:
>> I am using XDebug. Somehow its easy to set configuration file within
>> this plugin.
>>

Having disabled Zend in Eclipse config (great option) i'm now using
XDebug. But that is sending all output to Console instead of Browser
like ZendDebugger does, so no html makeup translation.

>
> So I started playing around with the entries, until I saw in the
> phpinfo() in Eclipse, that the directories for /ext and php.ini itself
> were totally different to what was written in the configuration i.e.:
> Path to php.ini = "C:\WINDOWS\". Also at C:\WINDOWS existed no php.ini!
> I checked all the other entries and finally looked at the path to the
> php.exe, which stood as "C:\php5". Again, at C:\php5 existed no
> directory at all and no php.exe!
> I figured out, the plugin had a completely own php.ini!
>
> At
> C:\Eclipse_3.3\plugins\org.zend.php.debug.debugger.win32.x86 _5.2.6.v20070507\resources\php5
>
> is a directory with a php.exe and a php.ini. THE one, which the Zend
> Debugger uses.
> In it was written only:
> zend_extension_ts=.\ZendDebugger.dll

That's exactly what i found, also in my case the php-version when using
the debugger is 5.2.2 while my xampp is 5.2.3. Where does the debugger
get it's php setting from?

>
> So I added the other needed extensions:
> ; Directory in which the loadable extensions (modules) reside.
> extension_dir = "C:\wamp\php\ext"
> extension=php_mysql.dll
> zend_extension_ts=.\ZendDebugger.dll
>
> Now everything is working as expected and the mysql-functions are there.

This did not work for me, i read about this trick somewhere else also,
but no good for me.

> I'm thinking about copying the php.ini from C:\wamp\Apache2\bin to the
> Eclipse-php.ini in order to get all extensions loaded.

Which one would that be? Only php.ini i can find in the eclipse install
is the one used by ZendDebugger.

I also tried using the xampp php-executable setting, i.e. the path, in
the Ecplipse PHP Debug options, but as long as Zend is active as an
option, Ecplipse keeps the debugger executable as the default, and i
keep getting "None Defined" when selecting XDebug as default debugger.
Only after disabling Zend as an option in Eclipse config, i could and
use XDebug.
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #52359 is a reply to message #52311] Mon, 17 September 2007 19:23 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: acdc.and.me.gmail.com

Alex vd Hoek schreef:
> Marcus Wobig schreef:
>> Martin Eisengardt schrieb:
>>> I am using XDebug. Somehow its easy to set configuration file within
>>> this plugin.

In addition to my previous reply. When debugging as Web Page XDebug
sends output to my Firefox-browser while stepping thru my breakpoints.
Not bad, but i would prefer the Eclipse internal browser....
Is that an option with XDebug?
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #52520 is a reply to message #52359] Tue, 18 September 2007 09:17 Go to previous messageGo to next message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
It is possible to use the internal browser. You need to configure eclipse to
use it. This is done in Preferences. The Web Browser option is under the "General" tree.

Dave Kelsey



Alex vd Hoek wrote:
> Alex vd Hoek schreef:
>> Marcus Wobig schreef:
>>> Martin Eisengardt schrieb:
>>>> I am using XDebug. Somehow its easy to set configuration file within
>>>> this plugin.
>
> In addition to my previous reply. When debugging as Web Page XDebug
> sends output to my Firefox-browser while stepping thru my breakpoints.
> Not bad, but i would prefer the Eclipse internal browser....
> Is that an option with XDebug?
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #53207 is a reply to message #52520] Wed, 19 September 2007 18:56 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: acdc.and.me.gmail.com

Thnx for the reply Dave, but in pref it's set to use internal browser,
and Zend debugger worked well using it. Xdebug seems to make it's own
decisions. Never mind. it will do for now.

Dave Kelsey schreef:
> It is possible to use the internal browser. You need to configure
> eclipse to
> use it. This is done in Preferences. The Web Browser option is under the
> "General" tree.
>
> Dave Kelsey
>
>
>
> Alex vd Hoek wrote:
>> Alex vd Hoek schreef:
>>> Marcus Wobig schreef:
>>>> Martin Eisengardt schrieb:
>>>>> I am using XDebug. Somehow its easy to set configuration file
>>>>> within this plugin.
>>
>> In addition to my previous reply. When debugging as Web Page XDebug
>> sends output to my Firefox-browser while stepping thru my breakpoints.
>> Not bad, but i would prefer the Eclipse internal browser....
>> Is that an option with XDebug?
Re: PDT, Wampserver and non-executed mysql-functions [SOLVED!] [message #53341 is a reply to message #53207] Thu, 20 September 2007 09:19 Go to previous message
D Kelsey is currently offline D KelseyFriend
Messages: 232
Registered: July 2009
Senior Member
Hi Alex, the xdebug launch should honour the internal web browser selection.
Does it ever work ? Which version of PDT are you using ?

Dave Kelsey

Alex vd Hoek wrote:
> Thnx for the reply Dave, but in pref it's set to use internal browser,
> and Zend debugger worked well using it. Xdebug seems to make it's own
> decisions. Never mind. it will do for now.
>
> Dave Kelsey schreef:
>> It is possible to use the internal browser. You need to configure
>> eclipse to
>> use it. This is done in Preferences. The Web Browser option is under
>> the "General" tree.
>>
>> Dave Kelsey
>>
>>
>>
>> Alex vd Hoek wrote:
>>> Alex vd Hoek schreef:
>>>> Marcus Wobig schreef:
>>>>> Martin Eisengardt schrieb:
>>>>>> I am using XDebug. Somehow its easy to set configuration file
>>>>>> within this plugin.
>>>
>>> In addition to my previous reply. When debugging as Web Page XDebug
>>> sends output to my Firefox-browser while stepping thru my breakpoints.
>>> Not bad, but i would prefer the Eclipse internal browser....
>>> Is that an option with XDebug?
Previous Topic:php.ini file
Next Topic:PHP not being parsed in browser of PDT
Goto Forum:
  


Current Time: Sat Apr 20 16:06:23 GMT 2024

Powered by FUDForum. Page generated in 0.06349 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top