What is PHP? Learn with me!

While HTML is a client-side language, PHP is a server-side scripting language. PHP earlier was known as Personal Home Page however, it is today, widely known as “Hypertext Pre-processor”

Why learn PHP?

As PHP is native to the web, you’ll be able to put simple projects online a lot quicker and with less difficulty, than you would be able to with some other languages, meaning you will see results for your efforts much quicker than if you were to learn another language.

Through this blog, I will be sharing with you my PHP learning journey. I am hopeful, that this will help others to learn as well.

Step 1 – To learn PHP language, you will have to configure a local development environment. Upon searching online, you will find many local development environment tools. These may be different for windows and MAC users. In my case, I am using XAMPP.

Step 2 – Download a code editor. Great if you already have one.

Step 3 – Create a new project.

How do you start writing PHP?

PHP code is embedded in HTML with tags <?php ?> There are however multiple ways to write PHP tag – <? ?>, <?= ?, <% %>. <? php ?> however is a universal command.

Always remember to us “;” to complete the command.

Using dynamic data: For how to have a element made available in all the pages without needing to added manually. Set a title – $tite = “Ratan Oberoi Official Site”; and to use to title in any page here is a example

What are comments and how to create – Comment is a message a reference for you and for others.

Types of comments: // example for only one line comments, /* example for multiple line comment */

How to setup a WordPress site on Namecheap.

Here is the step-by-step guide to setting up a project on Namecheap

Hello friends. Before we start, I am assuming that you have signed in and successfully purchased the hosting space with Namecheap.

1st Step – Go to the dashboard. Under recently active in your account, you will find 3 icons under Products. Hover on the center icon and you will see the option, “Go to CPanel”

CPanel is the control panel where all files and sites will eb managed from.

We are going to create the data base – If your going to write blogs, it needs to save the information for it to be persistent.

This is where WP will be storing the blogs.

To create the Database, first search Database. Ctrl+f search data base.

Under Databases you will find MySQL Databases.

1st thing we will do is to create the database so we need to name a database under create new database. Once entered name then hit create

Copy the database name and paste it in a notepad as name as database.

Next, create the user – This is to ensure that only certain users have an access.

Return to Namecheap. GO back and select the option to create new user.

Enter your preferred username which is consistent and easy for you to remember.

Create Password – Use the password auto generator.

Copy the username and password and store at a safe place. Save as Database user password.

Hit create user.  

Now close CPannel.

Now very important – we have to give the user the privileges to make any changes in the database.

So select the user and database and click Add.

Give all privileges.

Now – We will be downloading WordPress and set it up on our server.

Go to Google – Search – Download WordPress and download.

Now, go back to the NameCheap cPanel.

On the top left side – You will see a checkbox square icon which is the home icon.

Now since we already have the database created, we need to upload the WordPress on our server.

Look the File Manager on the top – Click on FileManager

Look for public HTML on the left panel, double click that. That is where the project will be served from.

Look for a upload radio button on the top. Click on upload.

Next – Brows/Drop the WordPress zip file there.

Wait until the upload progress turns green. Don’t assume its upload just when its 100%.

Close the upload window.

Go back to cPanel File manager – Look for the option to Reload and click and you will find the WordPress file. Double click and extract.

Once Extracted, delete the Zip.

We now need to ensure that not only the WordPress file but all its content need to be in the root.

For this – Get in the WordPress folder – Select All – Move to Public HTML. THis will move all the files to Root.

New delete the WP empty folder.

Look for Index.php

 New the next step is to setup WordPres.

To setup WordPress – Go to your website. Its gets setup automatically as you go to your website the first time.

It automatically finds the Index.php

It will automatically start the setup since the codes are already in the index.php by default.

When asked – Enter database name, user name and password.

Database host – local host. Tabel prefix – wp_

Click submit and then click Run the Installation.

Set the Title. Setup the site username.

Very Important – Save in a notepad the following details –

Site Details

Username: xxx

PW: xxx

Backend site: Your backend URL

Frontend: Your front end URL

WordPress has 2 major aspects – FrontEnd and BackEnd.

Congratulations on setting up your First project on Namecheap!