[HOW-TO]Install apache, php, mysql, pma

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
This is for you who often work with php and are tired of uploading the php script everytime you make an edit. This is very easy to do. MAKE A SYSTEM BACKUP WITH WINDOWS BEFORE YOU CONTINUE FOR SAFETY REASON!

Approx. time: 50 - 100 min (downloading kubuntu not included).

1. Download VirtualBox from http://www.virtualbox.org. If you already have it, skip this step.

2. Download a linux based OS. Kubuntu Gutsy Gibbons is used in this tutorial and can be downloaded here: http://mirror.mcs.anl.gov/pub/ubuntu-iso/DVDs/kubuntu/7.10/release/. i386 is most likely good for your system if you use windows xp home 32 bit. If you have 64 bit, download the AMD64 version. Same at Virtual Box.

3. Install VirtualBox.

4. When VirtualBox is installed, Open it.

5. Press "make new virtual machine"

6. Give it a name and in OS choose linux 2.6

7. Set like 512 - 1gb ram to it.

8. make a new harddrvie by pressing "new". Dynamic should be good. set like 10 GB to it.

9. finnish the wizard.

10. Now your virtual machine is created. highlit the machine in the list and press settings.

11. Now in the first option in the list, press the second tab. In the list that contain "harddrive" "network" etc, make sure everything is checked.

12. Go to CD-ROM/DVD-ROM

13. Check "mount" Then choose "mount .ISO" and browse to the iso file

14. Go to network and make sure everything is checked in the first tab. Use "NAT".

15. Now we are done with the settings. Press OK.

16. Highlit your virtual machine and press "run/start"

17. W8 for kubuntu to start. Choose "start or install kubuntu".

18. When you come to the desktop, press "setup".

19. Install kubuntu.

20. When it's done, close your machine and go back to virtualbox.

21. Press settings again. Go to CD-ROM/DVD-ROM and uncheck "mount"

22. Start kubuntu again.

23. When you are back at the desktop, press alt+f2 and type in kate /etc/apt/sources.list .

24. comment out the first 2 lines containing: deb cdrom .

25. save the file.

26. Now open a Terminal. you found it in the K - menu under system -> Konsole - terminalprogram

27. Type Sudo tasksel install lamp-server . This will install Apache2, mySQL and php 5. If it should be stuck on "installed php5-mysql 100%" I think you can close it after 10 min.

28. type sudo apt-get phpmyadmin in the terminal. This will install phpMyAdmin.

29. now type sudo install libapache2-mod-php5 in the terminal to enable php in apache

30. open "konqueror" (web browser) and type "localhost" in the adressbar.

31. You should see phpMyAdmin as a folder there. Press it and you come to phpMyAdmin. It will say something like "cannot connect to mySQL /using password: NO" or something. Above it there should be a link that says "Quick install" or something. Press it.

31a. If for some reason phpmyadmin isn't there, download it from here: http://www.phpmyadmin.net/home_page/downloads.php.

31.b. Extract it on your desktop by right click and choose extract. Copy the folder named "phpMyAdmin".

31.c. Press "system menu" between the K-menu and choose media.

31d. From there press "root" or just the harddrive.

31e. Go to var/

31f. mark "www" and to the right in the toolbar press "open as root". Paste the "phpMyAdmin" folder into there.

32. go trought the install (pretty easy).

33. when the install is done, You are done! You should now be able to open php files in your browser! To access phpMyAdmin go to localhost/phpMyAdmin.

You are done! Congratulations!

PART 2 - How to get your files from windows to kubuntu

1. Start virtualbox.

2. Mark your VM and press settings.

3. Go to shared folders and add a folder you wish to share and give it a unique name.

4. start Kubuntu.

5. Install "Guest additions" by pressing "install user additions" in the vbox menu on the top.

6. You should now get prompted by what to do. Choose open in new window.

7. Highlit that file with linux in it, and press "run as root" at the right.

8. Restart Kubuntu.

9. Open a terminal and type: sudo /sbin/mount.vboxsf NAME MOUNTPOINT. NAME is what you called your shared folder. MOUNTPOINT where you want to mount it. I recommend /mnt/share

10. To access it, press "system options" between the K menu. Browse to /mnt/share.

You are done!
 
Last edited:

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
Nice tutorial, but it would be quicker just to install XAMPP.

This contains:
Apache, MySQL, PHP + PEAR, Perl, mod_php, mod_perl, mod_ssl, OpenSSL, phpMyAdmin, Webalizer, Mercury Mail Transport System for Win32 and NetWare Systems v3.32, Ming, JpGraph, FileZilla FTP Server, mcrypt, eAccelerator, SQLite, and WEB-DAV + mod_auth_mysql
 

galaxyAbstractor

Community Advocate
Community Support
Messages
5,508
Reaction score
35
Points
48
sure XAMPP has more things but most of them are not needed for testing php scripts. And I think you don't need to start a FTP server on your computer to test them. It would be a security risk.
 

TechAsh

Retired
Messages
5,853
Reaction score
7
Points
38
If your computer is behind a firewall (and most are) then XAMPP is completely secure.

EDIT: You can also disable the FTP server using the XAMPP control panel.
 
Last edited:

Xemnas

New Member
Messages
812
Reaction score
0
Points
0
Good tutorial. I'd rather avoid XAMPP, you won't learn anything by running an installer package.
 

sclewin

New Member
Messages
88
Reaction score
0
Points
0
Nice tutorial thanks. But, would it not just be easier to install Kubuntu instead of Using Virtual Box. That would save about half of your steps. :)
 
Top