|
Basic Steps for setting up PHP, Joomla,
Wordpress... on your own local PC
This article is written to remind me about the
first steps to do after installing WampServer, but if it helps anyone who's
looking to enhance their web life by getting a hand into the thick of things,
that would be even better.
To make it easier for readers who are not so
familiar with these stuff, I just typed out a brief introduction
here.
First of all: You'll need to get this piece of
software called WAMPServer.
Where? Do a google search for it and download it,
you can get it from download.com too.
What does it basically mean -
Windows Apache
MySQL PHP.
So what do they do?
Read More...
Windows means your own PC's OS, as
opposed to Linux. In which case that would be LAMP instead.
Apache is the http server, to
enable your own PC to serve http pages - the standard pages that you open in
your browser.. such as this one. The other option is to use Microsoft IIS, but
that one is really a pain to set up (I've done that a number of times, but just
once is really enough.)
MySQL is a free database system,
where your entries, users, everything, is going to be stored. Having
written software that links to MS Access before, for our usage I would say that
MySQL is totally superior, easy enough to use, and free.
PHP enables you to use
server-side scripting - that is, enable you to write some
scripts which will be executed by the host (in this case, your own PC) to do
neat stuff, such as dynamically populating webpages with content pulled out from
a database like MySQL. It's a staple of the web scene nowadays; can't live
without it.
Apart from that, PHP already has many useful
built-in functions to process, filter and display text, as opposed to some other
programming languages where you have to write everything yourself. And being
web-oriented as it is, it gives you the potential for wide distribution of
whatever software you write... as opposed to the loneliness of writing
standalone programs - which I've been doing during an earlier period of my
life...
(BTW just slot in a note here - Anyone with
experience with PEAR? Gimme a buzz here...)
Installation of WAMPServer
This should be pretty straightforward, just follow
all the instructions. Gimme a buzz if in doubt.
At this point, for new users, you should make a
note of where you installed your Wamp, most likely in C:\wamp.
After installation and starting WAMP, you can go to
your browser and type in localhost in the address bar and go there. A default
status page will show up.
From there, you can view your MySQL database by
clicking on the PHPMyAdmin (PMA) link.
The first time you use PMA, you will enter the
database as the super administrator, without being prompted to enter a username
and password.
Obviously this is not secure especially when you
want to set up a live site, so this is what we want to change.
Bring up the "MySQL Console" by left-clicking on
the Wamp system tray icon (the 'speedometer'-looking thing), looking for that item somewhere there, and then follow the steps
below.
After bringing up that screen, follow the
instructions below:
Setting the MySQL Root Password
You need
to change the default root password on your MySQL Windows install. Write your
password down somewhere so you don't forget it.
At the MySQL prompt:
TYPE THIS AT THE PROMPT.
-
-
SET PASSWORD FOR 'root'@'localhost' = PASSWORD('yourpasswordhere');
-
DELETE FROM mysql.user WHERE Host= 'localhost' AND User= '""';
-
These commands change your root password and remove another out-of-the-box
root user to improve your security.
What you're actually doing is:
1. MySQL already has a default user (not sure what
the user name is, probably 'root', probably 'empty string'?) with a blank
password.
2. Anyhow you want to create a super-user, with a
username (most usually 'root') and password of your choice.
3. So you do the above.
And so you successfully done that. So now you try
to go log in to the PMA page again, but guess what?
mySQL: ERROR 1045: Access denied for user: 'root@localhost' (Using
password: NO)
You are rudely confronted by this error message
from PMA.
However, no need to panic, it just means that you
need to tell PMA that it needs to expect the user to enter a username and
password.
Go to your wamp installation folder, and search for
the file config.inc.php, usually it's in the phpmyadmin folder but the folder
name might be different for different installation packages of WampServer.
Anyway find that file, and open it in a text editor.
Look for these lines:
$cfg['Servers'][$i]['auth_type'] = '';
$cfg['blowfish_secret'] = '';
Change these to
$cfg['Servers'][$i]['auth_type'] = 'cookie';
$cfg['blowfish_secret'] =
'yoursecretwordhere';
If you like, you can look for these
lines
$cfg['Servers'][$i]['user'] = '';
$cfg['Servers'][$i]['password'] = '';
and change the values to '' (blank) as shown above.
I don't remember if these two also need to be changed for stuff to work, but I
think you can just leave it as it is.
Now what actually happens by choosing 'cookie'
means that you will be prompted for a username and password when you next try to
open PMA, In fact, do that now and log in, using the username and pwd that you
just created for yourself. You can try going to
Database>mysql(17)>user>Browse.. and see if you ('root') are the only
user there. Optional step, but the paranoid obsessive-compulsive me always does
that.
With that setting set to 'cookie', you can log in
and log out of PMA just as in those web-based mail services. That's just all it
means.
Now blowfish_secret, which apart from being a
really cute name, simply means a text string that is used to somehow encrypt
your password. Just write something here within the limit specified there in
config.inc.php, and forget about it.
...To be continued in the next post:
MySQL database character set, and
'collation'
Reference for above section:
$cfg['Servers'][$i]['user'] = ''; -- MySQL username if
you are using config method - otherwise leave
blank
$cfg['Servers'][$i]['password'] = ''; -- MySQL password
only if you are using config method - otherwise leave
blank
$cfg['blowfish_secret'] = ''; -- used with the cookie method
only. If you specified cookie in the auth_type above, type in a random
passphrase for this setting. The passphrase is just used internally to encrypt
the password - you will not be prompted for it later.
$cfg['Servers'][$i]['auth_type'] =
''; -- dictates the authentication method used when connecting to your
phpMyAdmin installation.
The three options for authentication are:
- config (the default method)
- http
- cookie (recommended method)
Tags: tutorial, PHP, Joomla, WAMP, MySQL, PHPMyAdmin |
Chinese Dictionary S...
Wow.. will download and try! XD
First Steps after in...
re: XAMPP vs. WAMP - I am not sure ...
MySQL database Chara...
Just to add to the article - to those...
First Steps after in...
XAMPP vs. WAMP - Thanks for sharing t...
MySQL database Chara...
Not only Joomla, everything else sho...