You are hereBlogs / hutcho's blog / Building a development environment
Building a development environment
Well I thought it was smooth sailing with my shiny new Ubuntu LAMP environment with Eclipse, PDT and SVN. But you know there is always something that keeps you guessing!! Below are some tips and experiences that had me tearing my hair out at times.
*** Apache2 PHP Save As dialog issue ***
Having got all the software setup and running, including phpmyadmin working and restoring databases (albeit needed to increase the PHP file upload limit in php.ini) I thought it was smooth sailing. But then I downloaded our source code and started getting Save As dialog boxes, for a long time I thought it was a configuration issue with Apache or PHP and spent about 6 hours stuffing around with that, but as it turned out it was a permissions issue to our log directory. PHP being unable to write to the folder for some reason decided to bomb out horribly and the only indication I could see of something going wrong was a save as dialog box and an error "exit signal Segmentation fault (11)" in the apache2 logs. "tail -f /var/log/apache2/error.log".
*** Setting the MySQL password ***
Update: the connection string was user@localhost, but when I created the user I created user@% which would not connect??
Anyway, phpmyadmin will create the user and password correctly, but you have to specify localhost when creating, not all (%).
FYI: These are some commands to set a password via command line and test that it worked.
* Logon to mysql command line environment *
$ mysql -u root -p
Enter root password
* Set password *
mysql> SET PASSWORD FOR usercreatedinphpmyadmin@localhost = PASSWORD('newpassword');
mysql> quit
* Test that it worked *
$ mysql -u usercreatedinphpmyadmin -p
enter password, if it worked it will log in.
References:
http://www.debuntu.org/how-to-create-a-mysql-database-and-set-privileges...
http://dev.mysql.com/doc/refman/5.1/en/passwords.html
* Eclipse and SVN *
Well not all smooth sailing here either. Installation of subversion (SVN for eclipse) was a breeze. But when we initially uploaded our source files to cvsdude we used the root path of the repository rather than creating a project folder to store files. Unfortunately this is not a very smart thing to do, and when you try to build a project using subversion it wants to see a project folder. Anyway, the solution was to move all the files and folders up a level to a project folder, however we found that we could only move one file/folder at a time, meaning that our 100 or so folders and files would have taken a lot of manual labour to move. Enter the command line "svn move" and a little bit of batch scripting.
I used windows to move the files (because I'm a bit more familar with batch files in windows)
Ran this command to get all the files:
dir /A-D /ON /B > allfiles.txt
Then used a spreadsheet to create a move script like so:
svn move -m "move files" http://oursvn.cvsdude.com/repo/afile.php http://oursvn.cvsdude.com/repo/project/afile.php
And there you have it, took about an hour for the script to move about 100 files, would have taken me much more to do it manually. (Drag and drop in Repo Browser)