AytchMan Posted February 14, 2008 Share Posted February 14, 2008 [This is no doubt covered somewhere but I've looked through some guides and can't puzzle it out.] I'm interested in learning about PHP and writing simple scripts. I don't want to run it off a server (with, say, Apache). I just want to run some scripts from the CLI. So, I downloaded the Windows binary, installed the thing and can get PHP to run (it opens up a PHP box on the desktop). And that's as far as I've gotten -- I'm unsure as to the next step. So, two questions: a. How do I actually create a script for PHP -- in PHP or a text editor or an HTML tool like FirstPage? b. Then, how and where do I load the script and actually run it? I appreciate any help. Quote Link to comment Share on other sites More sharing options...
awpti Posted February 14, 2008 Share Posted February 14, 2008 Create it in a text editor. Place the file in the same directory as your PHP binary, drop to the command prompt, go to the directory it's in and; php my_script.php Quote Link to comment Share on other sites More sharing options...
trq Posted February 14, 2008 Share Posted February 14, 2008 a: If your writting script for the cli there is no need for HTML at all. A simple test editor is best. b: Make sure the php binary is within your PATH, then simply open a cmd terminal and execute... php scriptname.php Quote Link to comment Share on other sites More sharing options...
AytchMan Posted February 14, 2008 Author Share Posted February 14, 2008 Ahh, I wasn't putting the script in the right directory. Many thanks. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.