Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » PHP Development Tools (PDT) » mysql_connect undefined when running script from Eclipse(mysql_connect undefined when running script from Eclipse)
mysql_connect undefined when running script from Eclipse [message #777083] Mon, 09 January 2012 20:11 Go to next message
Francisco Marzoa is currently offline Francisco MarzoaFriend
Messages: 11
Registered: January 2012
Junior Member
Hi there,

I am getting an error of mysql_connect function undefined when running a command line script for Eclipse, both on debugging or run mode (I have substituted the full path by ...):

PHP Fatal error: Call to undefined function mysql_connect() in .../mysql.inc.php on line 8

Executed directly from command line, the script works without this problem.

This is on an Ubuntu 11.10 box.

I have set on Preferences/PHP/PHP Executables the following parameters:

Executable path: /usr/bin/php
PHP ini file: /etc/php5/cli/php.ini

At first I did not included the ini file, but then I did to check if it solves the error without success.

Any hints?

Thanks a lot in advance,


Re: mysql_connect undefined when running script from Eclipse [message #777520 is a reply to message #777083] Tue, 10 January 2012 16:13 Go to previous messageGo to next message
dominik is currently offline dominikFriend
Messages: 122
Registered: July 2009
Senior Member
On 2012-01-09 21:11, Francisco Marzoa wrote:
> Executable path: /usr/bin/php
> PHP ini file: /etc/php5/cli/php.ini
>
> At first I did not included the ini file, but then I did to check if it solves
> the error without success.
>
> Any hints?
>
> Thanks a lot in advance,

It seems that You are running configuration that have no needed module loaded.
Run phpinfo and review configuration and paths, that should give you enought
info to solve issue with mysql.

/dmc
Re: mysql_connect undefined when running script from Eclipse [message #778107 is a reply to message #777083] Wed, 11 January 2012 12:22 Go to previous messageGo to next message
Toshihiro Izumi is currently offline Toshihiro IzumiFriend
Messages: 360
Registered: July 2009
Location: Japan
Senior Member
It is a well-known/notorious issue...

FYI
Bug 339547 - add "Use system default php.ini configuration" in EXE prefs
Bug 347618 - Additional PHP .ini files not parsed

For eclipse PDT which php.ini is it picking up for PHP scripts - Stack Overflow
...

It is a bug of pdt.
Re: mysql_connect undefined when running script from Eclipse [message #778183 is a reply to message #777520] Wed, 11 January 2012 14:35 Go to previous messageGo to next message
Francisco Marzoa is currently offline Francisco MarzoaFriend
Messages: 11
Registered: January 2012
Junior Member
Hi dominik,

If I run phpinfo() from within Eclipse, no mysql string is showed as expected: given the problem I have it is clear that within Eclipse there is no mysql support. But the question is why?.

Even when I explicitly set the same php.ini file that uses the cli php command on the same system and it does has mysql support.

Regards,
Re: mysql_connect undefined when running script from Eclipse [message #778188 is a reply to message #778107] Wed, 11 January 2012 14:41 Go to previous message
Francisco Marzoa is currently offline Francisco MarzoaFriend
Messages: 11
Registered: January 2012
Junior Member
Hi Toshihiro,

Interesting. I will try some of the workarounds exposed there.

Thanks a lot,
Previous Topic:How to connect to my local database server
Next Topic:'Open call hierarchy' (Ctrl-Alt-H) doesn't seem to work for me
Goto Forum:
  


Current Time: Tue Apr 23 17:38:54 GMT 2024

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

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

Back to the top