How to run PHP code on Windows?

sulochana anand

sulochana anand

@sulochana-anand-OrGmKr Oct 26, 2024
Beginner for php.i installed it on my system.typed code in notepad.after that wat should i do to run php.

Replies

Welcome, guest

Join CrazyEngineers to reply, ask questions, and participate in conversations.

CrazyEngineers powered by Jatra Community Platform

  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 3, 2012

    its in d:\ and i just run its setup.should i do some setting in my sysstem.as i typed my code in notepad where should i save it?and how to run it.please provive step.
  • [Prototype]

    [Prototype]

    @prototype-G9Gn5k Sep 3, 2012

    There are two ways.

    First is to run via command prompt. Open the command prompt and enter

    C:\php\php.exe -f "Path to the php file"
    More info here -> <a href="https://www.php.net/manual/en/install.windows.commandline.php" target="_blank" rel="nofollow noopener noreferrer">PHP: Command Line PHP on Microsoft Windows - Manual</a>

    Other method is installing Apache and transforming your computer to webserver. After that, you'll be able to use your browser to execute php scripts on localhost same as you do while visiting any website.
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 3, 2012

    thanx
  • monujatt

    monujatt

    @monujatt-1M9EHi Sep 4, 2012

    You can also download wamp and place ur php files inside the www folder and on ur local machine after starting the apache server of wamp , hit localhost:8080/test.php(test.php is the file placed in the www directory)
  • [Prototype]

    [Prototype]

    @prototype-G9Gn5k Sep 4, 2012

    XAMPP is better choice. I've used it & it works great.
  • Harish Kotra

    Harish Kotra

    @harish-OUjQxA Sep 4, 2012

    To run server based scripts like PHP you will need a local server which has the needed packages of Apace, PHP as they are needed for you. WAMP, XAMPP are among the popular windows based web development environments using which you can run your PHP scripts pretty much easily without much configuration required.

    Download them here - <a href="https://www.wampserver.com/en/" target="_blank" rel="nofollow noopener noreferrer">WampServer, la plate-forme de développement Web sous Windows - Apache, MySQL, PHP</a> or <a href="https://sourceforge.net/projects/xampp/" target="_blank" rel="nofollow noopener noreferrer">XAMPP download | SourceForge.net</a>
  • meetramprasad

    meetramprasad

    @meetramprasad-2MYwYb Sep 5, 2012

    It's simple just open the file path in any of your browsers. 😀
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 5, 2012

    i am opening but not working
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 5, 2012

    cean'n i am explaining wat i did----firstly i copied php in d:/ then installed xampp and got a folder xampp in my c:/i .firstly i uninstalled php as it was innstalled.then coied it to inside xampp folder's htdoc php(easy PHP-2.0b1).then created a page in www folder in notead.now trying to to open in broser as #-Link-Snipped-# its not working.what shoul i do?should i install it again?plese help.
  • Harish Kotra

    Harish Kotra

    @harish-OUjQxA Sep 5, 2012

    Uninstall everything mate. Download WAMP from the given link. Install it and let the location be the default one which is C:\wamp.

    Then after installation go to Start -> All Programs -> Wamp Server -> Start Wamp Server
    Then a notification icon will appear beside the time in the bottom corner of your screen and if it turns green then the server is online, else close any chat applications like Skype or Yahoo which will occupy the default port.

    Now if it is green go to C:\wamp and then in the www folder create a new folder of your specified name say example and then put the .php in there.

    Now go to the browser and type #-Link-Snipped-# and it should work 10% 😀
  • monujatt

    monujatt

    @monujatt-1M9EHi Sep 5, 2012

    Dear you didnt specify the folder name in which ur file is placed

    Hit- #-Link-Snipped-# if ur path is htdocs->www->filename.php)
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 5, 2012

    Harish Kotra
    Uninstall everything mate. Download WAMP from the given link. Install it and let the location be the default one which is C:\wamp.

    Then after installation go to Start -> All Programs -> Wamp Server -> Start Wamp Server
    Then a notification icon will appear beside the time in the bottom corner of your screen and if it turns green then the server is online, else close any chat applications like Skype or Yahoo which will occupy the default port.

    Now if it is green go to C:\wamp and then in the www folder create a new folder of your specified name say example and then put the .php in there.

    Now go to the browser and type #-Link-Snipped-# and it should work 10% 😀
    ok thanx i shall do it
  • meetramprasad

    meetramprasad

    @meetramprasad-2MYwYb Sep 5, 2012

    #-Link-Snipped-#
    Hi, Please do the following points and check.
    1)First, uninstall your XAMPP server.
    2)then, download the wamp server #-Link-Snipped-#
    3)Install it.
    4)Now, ypu will get a folder as wamp in your c\;
    5)Then, you put your code file inside the wamp folder.
    6)now you start the wamp server.
    7)you will get a taskbar icon in the desktop.
    8)Then, you open your file path in any browser (https://localhost/[folder name]).

    Thanks!
    Ramprasad.P
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 5, 2012

    th
    meetramprasad
    #-Link-Snipped-#
    Hi, Please do the following points and check.
    1)First, uninstall your XAMPP server.
    2)then, download the wamp server #-Link-Snipped-#
    3)Install it.
    4)Now, ypu will get a folder as wamp in your c\;
    5)Then, you put your code file inside the wamp folder.
    6)now you start the wamp server.
    7)you will get a taskbar icon in the desktop.
    8)Then, you open your file path in any browser (#-Link-Snipped-#[folder name]).

    Thanks!
    Ramprasad.P
    thanx
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 25, 2012

    thanx to all cean's now my php programs are running very easily
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 25, 2012

    please give some problem to work on php.so that my programming skill could be improved.
  • grayhat

    grayhat

    @grayhat-FImbA5 Sep 29, 2012

    sulochana anand
    Beginner for php.i installed it on my system.typed code in notepad.after that wat should i do to run php.
    i am karthik first you want to check whther the browser is php enabled or not using simple html coding.next php is an server side scripting language so you need to create one server then only you can run the php coding
  • theAvinash

    theAvinash

    @theavinash-DAs260 Sep 29, 2012

    to run php you need server. there are some local servers...try easyphp

    1)download it from <a href="https://www.easyphp.org/" target="_blank" rel="nofollow noopener noreferrer">EasyPHP - Code with Devserver & host with Webserver</a>

    install it.

    2)save your php files in'my portable files' directory under C: drive.
    Following is path..

    C:\Program Files\EasyPHP-12.1\www\my portable files

    3)run easyphp .

    4)start Apache server..right click on '"e" icon'/'Apache btton'... select 'local web' options from drop down menu..

    browser will get opened..click on portable files....select your file name...

    see output..😀
  • meetramprasad

    meetramprasad

    @meetramprasad-2MYwYb Sep 30, 2012

    #-Link-Snipped-#
    Hi, before entering in to php first of all you need some basic knowledge about HTML, CSS and mySql server. then You can enter in to php by creating a basic registration form with name, email etc and try to save that fields in the mysql server. Please refer the tutorial below which is the best tutorial to learn basics of HTML, CSS, PHP, SQL and some Jquery, Javescripts. 😀

    Thanks!

    Ramprasad.P
  • meetramprasad

    meetramprasad

    @meetramprasad-2MYwYb Sep 30, 2012

    #-Link-Snipped-#
    Sorry, I forgot to specify the link. Please refer this.
    <a href="https://www.w3schools.com/" target="_blank" rel="nofollow noopener noreferrer">W3Schools Online Web Tutorials</a>

    Thanks!

    Ramprasad.P
  • sulochana anand

    sulochana anand

    @sulochana-anand-OrGmKr Sep 30, 2012

    thanx to u all.i am having knowledge of html,java,javascript oracle css.so its easy to work with php.