So I have been working on setting up a Linux box with PHP5 and mysql mostly just to fart around with but also because I like learning how to do these things. I was having a hell of a time getting PHP and mysql to install properly on my distro - ubuntu 8
I originally installed PHP using apt-get and then installed mysql doing the same but was having issues getting them to work...no big shocker considering I am still fairly new to Linux. Eventually I did the following to get everything working, well so far anyway
Here it is:
1. sudo tasksel install lamp-server - this installs the entire LAMP stack (Linux-Apache-MySQL-PHP) and does most of the work for you (i like this)
2. sudo apt-get install phpmyadmin - configure it for apache2 (installed above) this helped me get rid of the Fatal error: Call to undefined function: mysql_connect() I was getting...basically php was not configured to speak to mysql
3. I really cheated on this one because I was getting the following error Lost connection to MySQL server at ‘reading initial communication packet’, system error: 111 like any good linux noob I decided to google that up and came up with an article located here that worked like a charm. Here are the steps:
* sudo gedit /etc/mysql/my.conf - comment the line corresponding to ‘bind-address’
* sudo gedit config.inc.php - in the /etc/phpmyadmin folder
* add or edit a line $cfg['Servers'][$i]['host'] = ‘localhost’;
* restart mysql using sudo /etc/init.d/mysql restart
Anyway...HTH
Technorati Tags: Configuration, Development, Linux, mysql, PHP