Can you run php on wampserver?

Introduction: How to Run a PHP Script With Wamp Server

Let me explain today how to use the wamp server to run PHP files. You can use this method to run PHP scripts you may have obtained from somewhere and need to run with little to no knowledge of PHP. You can execute your scripts through a web server where the output is a web browser. So let's get started

Step 1: Installing the Server Software

To set up the server we are using a software called wamp server.

  1. First you need to download the wamp server according to your system specifications(32 bit windows or 64 bit windows) from here
  2. Install the file on your computer and keep the settings to default unless you have specific requirements.
  3. After Installation start Wamp server.

Step 2: Setting Up the Server

  • If the installation went well, you should have an new icon in the bottom right, where the clock is.
  • Click the icon to see the menu as given above(1). The icon should be green in color, if it is red/orange then there is an error. From here, you can stop the server, exit it, view help files, and see the configuration pages.
  • Click on localhost, though, and you'll see the page as above(2) : (Localhost just refers to the server running on your own computer. Another way to refer to your server is by using the IP address 127.0.0.1.)
  • If you saw the above page, then congratulations! Your PHP server is up and running, and you can make a start scripting PHP pages.

Step 3: Saving Your PHP Scripts

  • Whenever you create a new PHP page, you need to save it in your www directory. You can see where this is by clicking the www directory item on the menu.
  • When you click on www directory, you should see an explorer window appear.

  • The PHP Script you want to run should be copied into this directory.

  • This www folder for Wampserver is usually at this location on your hard drive:
    c:/wamp/www/

    Bear this in mind when you click File > Save As to save your PHP scripts.

Step 4: Running the PHP Script

  • You can run the PHP Script in two ways:

Method 1:

Open localhost through the menu in the bottom right of the taskbar.

A page should open in your browser and you should see a list called Your Projects

If you saved your PHP script at the right place you should see your script name in this list

Click on the script to run it

Method 2:

Suppose you have created a php script called test1.php. To launch

this script, you need to add the script name after localhost in your browser. So we type

http://localhost/test1.php

Your server knows where the www folder is, so you don't have to type it out: just add the script name to localhost. Likewise, if you create a folder under www then you'd just type this:

http://localhost/folder_name/script_name.php

Viola, your script should be up and running.

Step 5: Troubleshooting

If you encounter an error like "api-ms-win-crt-runtime-l1-1.0.dll is missing”, then you need to (re)install the Visual C++ Redistributable for Visual Studio 2015, either via Windows Update or download and directly install the Visual C++ Redistributable:

  1. Install all pending Windows Updates

1. Go to Start – Control Panel – Windows Update

2. Check for updates and install all pending updates, then restart the computer.

3. After the restart repeat the steps above again until no more updates are available.

2. Download the Visual C++ Redistributable 2015

  • For Windows 64-bit

Visual C++ Redistributable for Visual Studio 2015 (64-bit)

  • For Windows 32-bit

Visual C++ Redistributable for Visual Studio 2015 (32-bit)

  • Run the vcredist_x64.exe (64-bit) or vcredist_x86.exe (32-bit) and select Uninstall if already installed
  • (If you uninstalled) Run the .exe again and select Install and restart the computer

Be the First to Share

Recommendations

WampServer is a web development environment for Windows. It's easy to use, and once you know how, you'll be able to open and test a PHP script in it with no trouble.

Steps

  1. Can you run php on wampserver?

    1

    Download WAMP. Once you have downloaded it, locate the .exe and open it.

    • Download the WAMP version that suits your OS (e.g. if your OS is 64 bit, download that version.)

  2. Can you run php on wampserver?

    2

    Go to driver you installed wamp on\wamp64\www\.

  3. Can you run php on wampserver?

    3

    Create a new folder. Right click on any blank space and select New. Then choose Folder and give the folder a name (the folder name will be the project name in WampServer).

  4. Can you run php on wampserver?

    4

    Open any text editor (like Notepad).

  5. Can you run php on wampserver?

    5

    Write the script. Type in the script you want to test.

  6. Can you run php on wampserver?

    6

    Save the script. Save the script to the folder we created located at driver you installed WAMP on (\wamp64\www\wikihow). That can be done by clicking Ffile then Save as.

    • Give the file a name and do not forget to add .php (PHP File Extension) at the end of the file name (Ex. Wikihow.php).

  7. Can you run php on wampserver?

    7

    Close the text editor.

  8. Can you run php on wampserver?

    8

    Open your browser.

  9. Can you run php on wampserver?

    9

    Type "Local Host" in the address bar.

  10. Can you run php on wampserver?

    10

    Click on the project name from your projects

  11. Can you run php on wampserver?

    11

    Click on the PHP file to open it.

  12. Can you run php on wampserver?

    12

    Check the PHP file. If you spot any errors in the php file, go to \wamp64\www\wikihow and right click on the PHP. Click File > Open with and then Notepad. Try to find out the error and fix it. When you're done, click File > Save and refresh the PHP page to know if the error is fixed.

Add New Question

  • Question

    I have Windows 8 and wampserver installed on it. The icon with "all the services running" is seen. I clicked on my project folder and I got an error "This page can't be displayed. DNS server not found." Any suggestions?

    Can you run php on wampserver?

    That is a connectivity error. The internet may have lapsed temporarily or maybe the network cable is not plugged in or the modem/router may be off. It means that it is using the cloud but could not locate the connectivity. You may need to also look up more to do with wampserver or open a browser and do a search and see if you get the same error.

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit


About this article

Thanks to all authors for creating a page that has been read 47,930 times.

Is this article up to date?

Is WampServer a web server?

WampServer refers to a solution stack for the Microsoft Windows operating system, created by Romain Bourdon and consisting of the Apache web server, OpenSSL for SSL support, MySQL database and PHP programming language.

Where is PHP installed in WAMP?

Copy the file php_phalcon. dll to the PHP extensions folder. If WAMP is installed in the C:\wamp folder, the extension needs to be in C:\wamp\bin\php\php5. 5.12\ext (assuming your WAMP installation installed PHP 5.5.

Which app can run PHP?

To run PHP for the web, you need to install a Web Server like Apache and you also need a database server like MySQL. There are various web servers for running PHP programs like WAMP & XAMPP. WAMP server is supported in windows and XAMP is supported in both Windows and Linux.

What is the use of WampServer in PHP?

WAMP acts like a virtual server on your computer. It allows you to test all WordPress features without any consequences since it's localized on your machine and is not connected to the web.