Thursday, February 15, 2007
Eclipse, Php Ide and Gentoo
As I said yesterday, I successfully installed eclipse and phpide in my Gentoo box. I had also set up the link to mysql socket, as I had explained in my previous post.
However, as soon as I tried to run a php script that uses mysql functions I got this error:
Warning: mysql_connect() [function.mysql-connect]: Client does not support authentication protocol requested by server; consider upgrading MySQL client in /home/bettini/workspaces/php/dbtophp/share/db.php on line 23
could not connect to database
Fortunately, this is a known error in mysql documentation: http://dev.mysql.com/doc/refman/5.0/en/old-client.html.
In fact, I just did what that page says, i.e., reset the password to the "old" style:
mysql> SET PASSWORD FOR 'some user'@localhost = OLD_PASSWORD('your password');
and the error went away.
Probably this was due to the fact that mysql is version 5.0, but the php engine that comes with phpide (and that I use for running and debugging scripts from within Eclipse) still uses the old mysql functions for connecting to the database.
Saturday, September 30, 2006
Eclipse & Php: Php Ide
Eclipse is a wonderful IDE for programmers (extensible with plugins and for new programming languages) and I really enjoy using it! A sort of the Emacs of the new millennium (I'll keep on using Emacs too, though :-)
The Zend plugin for programming in Php with Eclipse, Php Ide also looks very promising! I started using it few weeks ago and found really helpful and powerful. It features syntax completion and an easy to use debugger (although I still haven't succeeded in debugging php programs as web servers).
Here's a screenshot during debugging:
I found it very productive and it is always kept upgraded (the version I'm trying is 0.2.4).
One of the problems I had was due to the use of MySql: when I run a php application I used to get this error:
Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2) in...This was due to the fact that the configuration of php used by php ide expects the socket for connecting to MySql server in /tmp/mysql.sock, but the Debian system I'm using is configured so that the mysql socket is actually in /var/run/mysqld/mysqld.sock.
Since I didn't find a way to configure this option in the php used by php ide, I simply create a symbolic link before starting php ide:
ln -s /var/run/mysqld/mysqld.sock /tmp/mysql.sock
With this "hack" I have no problem at all :-)
Pubblicato da betto a 5:02 PM 12 commenti