Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm a beginner learning PHP. I need a server and MySQL.

Is there an app in Ubuntu that I can download? I think I have installed something with PHP5 Server-side something. But when I clicked to use the app, it vanished. Where did it go?

share|improve this question
    
You can try XAMMP –  Mitch Aug 19 '12 at 10:13
    
you don't need a server to learn php. just start writing php code and you are learning php. –  Alvar Aug 19 '12 at 11:11
    
Thank you so much for your answer. In the tutorial, they said to install XAMPP (LAMP in Ubuntu). But From their website, when I havw downloaded and extracted the app, I cant move further. I dont remember exactly what it said, but nothing further happened. Perhaps I dont need a server, but in the tutorial, they said to install a server in the computer. Anyway, I'll try to study without and see how it goes. Do you know a totally beginners tutorial that works with Ubuntu or Linux ingeneral? –  anzaksonn Aug 20 '12 at 9:12
    
could you link the tutorial? I have no idea what they mean. But you normally don't start with the coolest things right away. You need to know a few things first. –  Alvar Aug 20 '12 at 14:57
    
could you accept the answer you think solved your question? –  Alvar Aug 20 '12 at 14:58
add comment

4 Answers

You can use Xammp Server. Or install local LAMP Server on Local Host.

share|improve this answer
    
Thank you so much for your answer. In the tutorial, they said to install XAMPP (LAMP in Ubuntu). But From their website, when I have downloaded and extracted the app, I cant move further. I dont remember exactly what it said, but nothing further happened. I did as Alvar, above, said and installed apache2 and I'll now attempt to study according to the tutorials. Lets see how that goes. Do you know any (free) tutorials for totally newbie to learn PHP that uses Ubuntu or Linux in general as the teaching medium? It would make things so much easier for me. Take care! –  anzaksonn Aug 20 '12 at 9:20
    
You can mark , a correct answer by clicking "Check" In front of your answer. –  BigSack Aug 20 '12 at 9:40
    
Regarding, your php Tutorials, many books are there for Ubuntu And MAC. Mac also works same way as Server on Ubuntu. You should not face much difficulty either. Bother are just same. Assuming you are using only php. –  BigSack Aug 20 '12 at 9:44
    
Here is something , follow this guide. easy-ubuntu-linux.com/learn-php.html –  BigSack Aug 20 '12 at 9:45
add comment

There are a number of guides around for setting up LAMP[1]. A quick search turns up these ones which take you through it step by step:

Good luck!

[1] - Linux Apache MySQL PHP/Perl.

share|improve this answer
    
Thank you so much for your help. I'll try them and see where they lead me. Take care! –  anzaksonn Aug 20 '12 at 9:26
add comment

There are many web servers you can use. I prefer the apache web server. install it by typing this in a terminal.

  • sudo apt-get install apache2

If you don't like terminal then just search for apache in the USC.

then add your html files to /var/www/. Now just go to your localhost and see your new website!

share|improve this answer
    
Thank you very much for your help. I did as you said and installed Apache2. Now I'll start studying.Take care! –  anzaksonn Aug 20 '12 at 9:14
add comment

One suggestion (there are other options):

First install synaptic package manager (sort of a pro version of software center):

sudo apt-get install synaptic apt-xapian-index

Webserver / php

Then open synaptic and install apache web server and php5. If you select "libapache2-mod-php5" it should pull in the necessary apache server and other things. Note, if you type "php5" in the quick search there is a lot of php5 related packages some of these may be needed as you go along, and you can just install them later.

Database

Install a database (my personal preference is postgresql but mysql is probably easier to get started with as it doesn't have the same level of security settings involved, I would strongly advice, though that you transition to postgres at a time when it feels convenient, it's more standards compliant and therefore your work and experience will generally be more broadly applicable, and the documentation is far better.). Select "php5-mysql" + "mysql-server" or "php5-pgsql" + "postgresql".

For mysql: during installation you will be asked a password for your mysql root account (it can be a bit confusing at times) this root/password is what you normally will give to php-apps you will be building and it's the password you'll give to phpmyadmin during installation also.

Database administration

Install phpmyadmin - a php-based administrator for mysql (or if you go with postgres, pgadmin3).

Coding editor

Finally install a suitable php editor or a full blown ide. As for editors I have no specific suggestion (just use the text editor you're comfortable with) but for ide I'll suggest netbeans (found in synaptic).

When this is done, your webroot will be /var/www/. This is where you put your php-files.

You can check that apache is running by going to http\://localhost/ where you should see the message

It works!

share|improve this answer
    
You gave me a fantastic and comprehensive guidelines. I cant thank you enough for taking the time. I'll try your methods tomorrow as I dont have time now. Take care! –  anzaksonn Aug 20 '12 at 9:24
    
You gave me a fantastic and comprehensive guidelines. I cant thank you enough for taking the time. I'll try your methods tomorrow as I dont have time now. Do know of any video tutorials for totally newbies to learn PHP on Ubuntu or Linux in general desktop. I cant find any on youtube. All are on Windows there. Thank you once again. Take care! –  anzaksonn Aug 20 '12 at 9:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.