Top Menu

Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu
Showing posts with label PHP. Show all posts
Showing posts with label PHP. Show all posts

Tuesday, 9 May 2017

Install WordPress locally on your Windows using WAMP Server

Having WordPress set up as a localhost on my computer has become invaluable to my workflow, particularly as I regularly test themes and plugins.


WordPress is a free and open source tool – a content management system (CMS) based on PHP and MySQL. WordPress powers 24% of the internet and growing stronger day by day. Numerous websites are created using WordPress every single day. It is the most powerful hosting platform and is the easiest way to create a free website or blog in short span of time.

WordPress is a fun blogging software, and if you are one of those who likes to try new things on your WordPress blog, it’s always a good idea to get a local installation of WordPress on your system. You can use it to try new WordPress plugin, making changes in your theme and many more task.

Benefits of using WordPress:

  • Before setting up and configuring custom domain using WordPress, one can always install WordPress locally for testing or learning or developing plugins for the same.
  • Users can install WordPress in their machines to test the themes, plugins and ensure that setup is perfect to deploy to the server.
  • WordPress is very easy to use. Adding new pages, blog posts, images, etc. on a regular basis is a can be done quickly.
  • It is SEO friendly.
  • As an administrator of a WordPress site, one can set-up multiple users for the website and assign access levels and capabilities to each user.
  • Supports Multilanguage

Did you know that you can install WordPress on your own Windows computer for learning and testing? Working with WordPress for Windows is a great way to test plugins, updates, and other website changes before pushing them live to your audience.

Setting up a local server environment for WordPress isn’t difficult and will save you time in the long run since you won’t have to install and uninstall a fresh copy of WordPress online each time you test or develop something for WordPress.
There are many options for Windows. I’ve previously looked at how to set up a localhost using XAMPP. WAMP is a Windows web development environment and is combination of Apache2, PHP, and a MySQL database. In this tutorial I’ll walk you through how to set up WampServer, including installation, creating a MySQL database, and installing WordPress.


Please follow the steps mentioned in below link for installing WAMP on your PC

Installing WampServer on your PC

After installing WAMP you have to run the WAMP server. Always remember to first activate WAMP server simply by double clicking on its icon. After activating it, the icon will become green from red in the task-bar. Also make sure that you have started 'Start all services'

The color of the WampServer icon allows you to quickly determine the status of your servers.
  1. If the icon is red, the server isn’t running and is offline. You may need to restart WampServer or check out the WampServer forums for more help.
  2. If it is orange, the server is partially running, i.e. Apache may be running and the MySQL service is offline. Click on the WampServer icon and check the service status next to Apache and MySQL to see if they are running. You may need to restart WampServer, and if it still doesn’t work, check out the WampServer forums.
  3. If the icon is green, it means the server is running and you should be able to access localhost from your browser.
To test it, go to “localhost” in your browser.


Note: At times, While installing sometimes WAMP shows error 'MSVCR100.dll' is missing.


How to remove or fix this  above error click here

Before we install WordPress, we need a database.

Setting Up Your MySQL Database

Click on the WampServer icon in your system tray and then click on phpMyAdmin.


 A new browser window will automatically open with the phpMyAdmin interface.


Click on “Databases” near the top-left and you’ll be prompted to create a new database. I’ve called mine “WP”.
When you’ve entered a name, click “Create” and close the window.


Download and Install WordPress

 

Download the latest version of WordPress.
In order to get WordPress working with WampServer you need to unzip WordPress to the right folder. Extract WordPress to the C:/wamp/www/ folder.
You can rename the WordPress folder whatever you like. I’m going to keep it as “wordpress.”

Next, open your WordPress folder, find the wp-config-sample.php file and rename it wp-config.php. Open the file and scroll down until you see the following lines:


 These lines of code define the login details for your database. Replace “database_name_here” with the name of your database, which in my case is “WP.”
Replace “username_here” with “root” and leave “password_here” blank.
Save the file and close it.
Now we can get on with installing WordPress.
Open your browser and go to http://localhost/wordpress/
The WordPress database setup will start automatically. First it will ask you to select your language. After that it will show you some information about setting up your database. Click the Let’s Go button when you’re ready.
On the next screen, you’ll need to provide your database information. The database name will be the one that you entered in the last step. In our case, we called it test_db.
Your default database username will be root and you can leave the password blank.
Next, click on the submit button and WordPress will create a configuration file for you.


 After this you will see a screen informing you that WordPress has successfully connected to your database, and you can proceed with the installation.
Go ahead and click the Run the install button.


On the next screen, you can fill out the installation form. You need to provide a title for your website, choose an admin username / password, and provide admin email address.
Once you’re ready, press the Install WordPress button.


WordPress will quickly run the installation and create database tables. Once done, you will see a success message after the installation is complete.
You can then proceed to your WordPress dashboard by clicking on the Log in button.
Congratulations, you have successfully installed WordPress on a windows computer using WAMP.






Read more...

Friday, 5 May 2017

How to install WAMP Server on Windows 10

If you are looking forward to developing application in PHP, first thing you want is to set up a development environment. On Windows, WAMP is a popular choice. Let me show you how to install it on Windows 10.

Note: WAMP is not the only choice you have for windows. You can also choose XAMPP which is also stable and good. For Linux you can try LAMP and for Mac, MAMP. Please don’t waste your time in comparing various alternatives available to you. They are all good. All I can say is that get yourself a development environment quickly and start coding. WAMP is a very good choice and is very stable. Go for it.

Here are the installation steps.
Step 1- Download Wampserver from the WampServer website.

Step 2- Scroll down to the download section of the WampServer Home page.

Based on your system, choose 32 bit or 64 bit version of the installer. I choose 64 bit, PHP 7 version because this is the latest release of PHP.

Step 3- Click the appropriate link to download the Installer.

You should see something like this. Click the download directly link to start download.

You will see download will begin from the sourceforge.net webpage. 

Step 4- Locate the downloaded file.

By default it should be in your downloads folder if you have not changed the default settings.

Step 5- Double click the installer to begin the installation.

You should see something like this.

Click Run to proceed. Now you should see Windows User access control dialog box. Click Yes to continue.

Step 6- The dialog box that appears will now ask you to choose your language for installation.

Select your preferred language from the drop down list and click OK. We will be using English for this demonstration.

Step 7- Next dialog box is Welcome to WampServer64 Installation Wizard.

Click Next to Continue.

Step 8- You should see WampServer Licence agreement dialog box.

Click “I accept the agreement” radio button and next to continue.

Step 9- Now you should see an information dialog box.

This informs you about the prerequisites, or the required component that must be present on your windows machine for the WampServer to function correctly. What’s required is the appropriate version of Microsoft VC++ re-distributable package. You can still continue to install WampServer without issues. 

Step 10- Select the location where you want to install WampServer.

You can accept the default and click next.

Step 11- Select Startup Menu Folder.

In this dialog box you have to select the folder in which the program shortcuts should be placed. If you select the default, it would be placed in C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Wampserver64. This folder content is accessible from the windows start button, all apps in windows 10. If you place in any other folder, the shortcut will not be visible from the start menu.

You can change it to something else but accepting the defaults is perfectly good. The 64 at the end of Wampserver64 is tell you that you will be using the 64 bit version of the application. If you dont see 64, then you will be using the 32 bit version of the application.

Step 12- Finally you see the Ready to install dialog box.

You can review the details and make the changes by going back by clicking the Back button. Once you click Next, installation begins.

Click Next to begin Installation. Now you will see installation begins. 

Step 13- Select default browser dialog box

Now you should see a dialog box asking you if Internet Explorer should be made the default browser and asks you if you want to change the default browser to something else. Click NO to accept Internet explorer as the default browser.

If you want to change the default browser to say Google Chrome, click Yes and you should see the screen to change the default browser.

In Windows 10, Google Chrome executable is located in C:\Program Files (x86)\Google\Chrome\Application folder by default. Go to this folder and select chrome.exe and click open. If you click cancel, it would again default to Internet Explorer.

Again the choice between Internet Explorer and Chrome or anything else is purely personal and I don’t see any issue in accepting the default and leaving it as Internet explorer.

Step 14- Select default Text Editor

I would suggest you can accept the default, which is notepad by clicking No. Its just that if you want to edit apache or PHP config files such as http.config or php.ini, it would open in notepad. Still if you want to change it you can click Yes and navigate to the executable .exe file of your preferred text editor. But, as I said, the default notepad is perfect.

Step 15- phpmyadmin Information dialog box

After the installation is complete, you will see a dialog box informing you that the user name for phpmyadmin is “root” and password is not set, that is there is no password for it. Click Next to continue.

Step 16- Installtion Complete

Now you should see installation complete dialog box. Click finish to exit the WampServer installation wizard. WampServer should now be installed on your system.

Step 17- Start WampServer

You can now start the WampServer by double clicking on the shortcut wampserver icon on your desktop or alternatively launch it from the start menu. After the WamServer starts, you can see the Green icon on the taskbar as shown in the screenshot. Initially it will be Red, then turn amber and then Green. When it turns green, it means all the services are now running. Else, the WampServer has not started. Please note that you will have to give adminsitrative privilages for the Server to start. That is just click Yes when you see UAC confirmation dialog box when you click the Wamserver icon to start the server.

When you right click on the icon, you can see the options to start, stop and restart the WampServer along with other option which I leave for you to explore. If you face any problem, please leave the question as a comment, I will answer them.

That’s it, you are done.


Read more...

What is: MySQL

MySQL is a database management system that is used by WordPress to store and retrieve all your blog information. Think of it this way. If your database is a filing cabinet that WordPress uses to organize and store all the important data from your website (posts, pages, images, etc), then MySQL is the company that created this special type of filing cabinet.

MySQL is an open source relational database management system. It runs as a server and allows multiple users to manage and create numerous databases. It is a central component in the LAMP stack of open source web application software that is used to create websites. LAMP stands for Linux, Apache, MySQL, and PHP. Most WordPress installations use the LAMP stack because it is open source and works seamlessly with WordPress.

WordPress requires MySQL to store and retrieve all of its data including post content, user profiles, and custom post types. Most web hosting providers already have MySQL installed on their web servers as it is widely used in many open source web applications such as WordPress.

WordPress uses the PHP programming language to store and retrieve data from the MySQL database. To retrieve data from the database, WordPress runs SQL queries to dynamically generate content. SQL stands for Structured Query Language and is the programming language typically used to query databases.

For users that are not comfortable writing their own PHP and SQL scripts, most web hosting providers offer easy to use web applications to manage databases. One such web application is phpMyAdmin which allows users to manage their database using a web based graphical interface. You can manipulate your tables visually while phpMyAdmin runs the SQL queries for you.


Out of the box MySQL doesn’t come with any graphical interface and advanced level users may prefer to just manage their databases from the command line.
Read more...

What is: PHP

PHP is a programming and scripting language to create dynamic interactive websites. WordPress is written using PHP as the scripting language. Just like WordPress, PHP is also an Open Source.

PHP is a server side programming language. When a user requests a web page that contains PHP code, the code is processed by the PHP module installed on that web server. The PHP pre-processor then generates HTML output to be displayed on the user’s browser screen.

Example of a simple PHP code:
<? php
    echo "Hello World!";
?>
                           
In WordPress PHP files usually have a .php extension. PHP can be used inside HTML documents. The PHP pre-processor only processes code inside the php opening tag <?php and the closing tag ?>.

Example of PHP code inside an xHTML document.
<!DOCTYPE html>
<html <?php language_attributes(); ?>>
<head>
<meta charset="<?php bloginfo( 'charset' ); ?>" />
<title><?php bloginfo( 'name' ); ?></title>
</head>

 A WordPress user does not need to learn PHP in order to use, run, or manage a WordPress powered website.

Most users can use WordPress without ever learning to program or code in PHP. However, if a user wants to develop WordPress themes, plugins, or modify default behavior of WordPress by using actions and filters, then they would need to learn the basic syntax of PHP along with HTML and CSS.
Read more...

Install WordPress on your Windows Machine Using WAMP

You can you can install WordPress on your own Windows machine for learning and testing? Working with WordPress for Windows is a great way to test plugins, updates, and other website changes before pushing them live to your audience. Here, I’ll show you how to install WordPress locally using WAMP.

The process of installing WordPress on your personal computer is also known as setting up a local server environment or localhost. Often theme designers and plugin developers install WordPress on a local server environment to speed up their development process.

It’s a good idea to use WordPress for Windows in order to test any major changes to your site. This way you can catch and fix any issues before they affect your audience.

Note: If you install WordPress locally on Windows, then the only person who can see that site is you. If you want to create a WordPress blog that is available to the public, then you need to have a domain name and web hosting. We recommend that you follow this guide on how to install WordPress.

Having that said, let’s take a look at how to install WordPress on localhost using WAMP.

What is WAMP?

WAMP, also called WampServer, is a compilation of Apache web server, PHP and MySQL bundled for Windows computers. You need WAMP to setup your own local server environment and install WordPress on Windows. There are other clients for Windows such as XAMPP, but we use and recommend WAMP. It is free and easy to use.

Installing WampServer on your PC

The first thing you need to do is go to the WampServer website and download the latest WampServer. You will be presented with various options on their download page. Simply choose the one that applies to your Windows (64-bit or 32-bit). When in doubt, select the 32-bit version because it will also work on 64-bit versions of Windows.

Once you have downloaded WampServer, run the installation program and carefully follow on-screen instructions.

At one point during the installation, WampServer will ask for the location of the default web browser.
By default it will use Internet Explorer, but you can change that to Google Chrome or Firefox by locating the browser in Program Files.


Once you are done with the installation, launch WampServer.

Setting Up a Database for WordPress

Next, you’ll need to create a blank MySQL database WordPress can use.
WampServer comes with phpMyAdmin, a web based application to manage MySQL databases. Click on the Wampserver icon in windows taskbar and then click on phpmyadmin.

 

The phpMyAdmin login screen will open in a new browser window. By default, the Username will be root, and you can leave the password field blank.

Once logged in, click on Databases in phpmMyAdmin to create a new database for WordPress. You will be asked to choose a name for your database (we named ours test_db). After that click on the Create button.


Installing WordPress on Windows with WAMP

The next step is to install WordPress. You will need to download a copy of WordPress from WordPress.org. Go ahead and extract the zip file and copy the wordpress folder.

After that, you need to navigate to the folder where you installed WAMP.

In our tutorial, we installed it in C:\wamp64, so we’ll refer to that folder going forward. But keep in mind, it may be different for you depending on where you installed the program.

Paste the wordpress folder into the C:\wamp64\www folder.

You can rename the wordpress folder to anything you want, such as mysite, wpbeginner, etc. This will be the URL of your local WordPress site, so be sure to choose something you’ll remember easily. For the sake of this tutorial, we renamed our wordpress directory to mysite.

Now open your web browser and go to http://localhost/mysite/

The WordPress database setup will start automatically. First it will ask you to select your language. After that it will show you some information about setting up your database. Click the Let’s Go button when you’re ready.

On the next screen, you’ll need to provide your database information. The database name will be the one that you entered in the last step. In our case, we called it test_db.

Your default database username will be root and you can leave the password blank.

Next, click on the submit button and WordPress will create a configuration file for you.


After this you will see a screen informing you that WordPress has successfully connected to your database, and you can proceed with the installation.

Go ahead and click the Run the install button.

 
On the next screen, you can fill out the installation form. You need to provide a title for your website, choose an admin username / password, and provide admin email address.

Once you’re ready, press the Install WordPress button.


WordPress will quickly run the installation and create database tables. Once done, you will see a success message after the installation is complete.

You can then proceed to your WordPress dashboard by clicking on the Log in button.

Congratulations, you have successfully installed WordPress on a windows computer using WAMP.
Below are some additional notes that might help.

Troubleshooting WAMP Skype Error

If you have Skype installed and running, then WampServer may not be able to work properly due to a conflict with Skype. The conflict is caused by both Apache and Skype using the same port 80. There is a simple fix for this problem. Open Skype and go to Tools » Options. Click on Advanced and then Connections. Uncheck the box that says Use port 80 and 443 as alternatives for incoming connections. Save options and restart Skype.


Enabling Pretty Permalinks in WAMP

Pretty permalinks will not work by default on your local server environment. All your URLs will look like localhost/mysite/?p=18. If you go to Settings » Permalinks and use one of the other options, then it will show you “page not found” errors. We have already written about a solution here that will show you how to enable custom permalinks in WAMP.

Migrating from WAMP to Live

We’ve also written a separate guide on how to move WordPress from WAMP local server to a live site. Hopefully you’ll find it helpful when you are ready to deploy your local site to production.
We hope that this article helped you install WordPress on your Windows computer using WAMP. Having a local server environment is great for learning and testing purposes.

Remember, if you want to start a blog for other people to see, then you do not need to install WordPress on your computer. You need to install WordPress on a web hosting provider.
Read more...