How to run PHP code on Windows?

Beginner for php.i installed it on my system.typed code in notepad.after that wat should i do to run php.

Replies

  • sulochana anand
    sulochana anand
    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]
    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 -> PHP: Command Line PHP on Microsoft Windows - Manual

    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
    thanx
  • monujatt
    monujatt
    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]
    XAMPP is better choice. I've used it & it works great.
  • Harish Kotra
    Harish Kotra
    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 - WampServer, la plate-forme de développement Web sous Windows - Apache, MySQL, PHP or XAMPP download | SourceForge.net
  • meetramprasad
    meetramprasad
    It's simple just open the file path in any of your browsers. 😀
  • sulochana anand
    sulochana anand
    i am opening but not working
  • sulochana anand
    sulochana anand
    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
    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
    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
    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
    #-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
    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
    thanx to all cean's now my php programs are running very easily
  • sulochana anand
    sulochana anand
    please give some problem to work on php.so that my programming skill could be improved.
  • grayhat
    grayhat
    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
    to run php you need server. there are some local servers...try easyphp

    1)download it from EasyPHP - Code with Devserver & host with Webserver

    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
    #-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
    #-Link-Snipped-#
    Sorry, I forgot to specify the link. Please refer this.
    W3Schools Online Web Tutorials

    Thanks!

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

You are reading an archived discussion.

Related Posts

i installed java and set parh.but when i m compiling with javac it is giving an error --could not find run time enviornment ,and java.dll.what should i do any one...
Hello! I've a question for automobile engineers. What exactly is 4x4 and 4x2 type described in vehicle specifications?
hello everyone...can anyone tell me in how many ways can we produce electricity.. eg: by potatoes and by citrus friuts and by garbage waste... i want to know is there...
Hello all, I am ojai, an electronics and electrical engineer from Meerut. I wanted to discuss about - How can i produce electricity in water? Is it possible? Please share...
i am a final year instrumentation and control engineering student i cant able to get any idea for my project so please help me friends to give a good idea...