How to install LAMP on centos 6.2
I am very new to this. I am trying to install LAMP on centOS 6.2 using yum -y install php
but I am getting this error
Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=6&arch=x86_64&repo=os error was
14: PYCURL ERROR 6 - "Couldn't resolve host 'mirrorlist.centos.org'"
Error: Cannot find a valid baseurl for repo: base
Is there something I have to do before installing?
below error shows that your DNS configuration is not working as expected. check your internet connection
Could not resolve host 'mirrorlist.centos.org'
if you can ping or dig in the result like below.
ping mirrorlist.centos.org
dig mirrorlist.centos.org
had the same problem, i am using centOS7 but i will tell you how i fixed it if it helps.
try changing your network config file:
vi etc/sysconfig/network-scripts/ifcfg-eth0
eth0 is the default name, but it doesn't always have to be like my
vi etc/sysconfig/network-scripts/ifcfg-enp0s3
Note: when you open a file with vi, you need to press i (insert mode) to be able to enter and edit eddit.
When you open it, you will see multiple lines with yes - no assertions
I moved ONBOOT=yes
toONBOOT=no
Note: when you're done, you need to press ESC to exit insert mode and type the following: :wq
press enter and save.
You will be returned to the terminal, from here type dhclient
hit enter and try running the command againyum -y install php
If you get the same type of error reboot
to reboot the system and when it comes back again, enter dhclient
and try again.
This worked for me for now, hope it works for you too.