Thursday, August 6, 2009

Linux PHP-MySQL Configuration Nightmare

Linux PHP-MySQL Configuration Nightmare

Have you ever tried to configure MySQL to Aptana PHP in linux ?
Here are the easiest steps to follow to accomplish that easily.

1- The one should have installed MySQL libraries --> client, server
and adminstrator from Synaptic Manager in ubuntu
2- Create a php project
3- php file containing: call it "sossa.php"



run in aptana --> u get an error --> can't connect to local mysql
server through socket '/tmp/mysql.sock'
so what to do --> the socket file is existing is /var/run/mysqld/
mysqld.sock --> so vreate a link from the tmp folder to that file
how tooooooo ???!!!
Note: Only the text between quotes will be put in terminal

1- open the terminal as root (adminstrator).
Terminal--> "
sudo -i"
and type ur password.

2- Go to the tmp folder.
Terminal--> "
cd /tmp/"

3- Make the link.
Terminal--> "
ln -s /var/run/mysqld/mysqld.sock mysql.sock"
4- u have to edit my.cnf file to the local host ssetting u did when setting up MySQL

Terminal--> "
gedit /etc/mysql/my.cnf"
a text editor is running --> find the statement "bind-address"
and make its value = "localhost"
The line would be as follows

bind-address = localhost

5- Restart MySQL.

6- Run "sossa.php" && enjoy MySQL in aptana witout the need for XAMPP
now preview the php file in aptana and the error is gone
the output is just:
Nice Work

No comments:

Post a Comment