Running PHP from Windows XP command line interface
Posted by: brendan (---.b-ras1.blp.dublin.eircom.net)
Date: July 08, 2010 07:16PM

Hi,

I'm using WAMP: PHP (5.3.0) Apache (2) and it seems to be working ok. I'm trying to run PHP code from the command line on Windows XP in order to check it. It runs fine on the virtual server with Firefox. I've checked the PHP online manuals and other sources but can't seem to find any two that agree on how to achive this. One set of instructions said that I should copy 5 files to the Windows System 32 directory:

php5ts.dll
php5apache2.dll
php_mysql.dll
libmsql.dll
php.ini-dist.dll

Problem is that the last two dll files: libmsql.dll and php.ini-dist.dll don't seem to exist anywhere on the www.php.net/downloads site, or anywhere else. Anyone got any ideas as to how I can achieve this?

Regards,

Brendan

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: stevenmartin99 (---.b-ras2.blp.dublin.eircom.net)
Date: July 08, 2010 07:32PM

php has a command line.. you would need to add an enviormental variable to get it to work in cmd


but other than that. just drop a php file onto the php-win.exe file

ul need the php5ts.dll only

Steven Martin
stevenmartin99@gmail.com
stevenmartin99@hotmail.com
PampServer.com - [pampserver.com]

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: yfastud (Moderator)
Date: July 09, 2010 09:21PM

if you dont want to add an enviormental variable, just simply setup your php files to be able to run as commands which is much better since you can run your php files in any os w/o messing up w/ enviormental variable winking smiley

Have fun,

FREE One A Day
FREE Photo
FREE Games
FREE Websites
FREE Portable GPS
FREE WAMP Guides

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: brendan (---.b-ras1.blp.dublin.eircom.net)
Date: July 12, 2010 08:12PM

Thanks Steven and Yfastud,

For getting back to me so quickly. I'll give it a try and see what happens

Regards,

Brendan

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: brendan (---.b-ras1.blp.dublin.eircom.net)
Date: July 13, 2010 09:03PM

Thanks for that. I got the PHP command line up and running. It's pointing to C:\php\php.exe. Do I have to alter an element my php.ini file now??? I'm asking due to the fact that I put in the code:

$ php -v

In order to see if it was connected properly but had no joy.


Regards,

Bren

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: charlesblackwell412 (165.190.89.---)
Date: July 15, 2010 03:48AM

Do wamp install PHP in c:\php?

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: charlesblackwell412 (165.190.89.---)
Date: July 15, 2010 03:49AM

I can't get the path variable to work on my machne. All I get is this error:
'php' is not recognized as an internal or external command, operable program or batch file.


I am running the latest version of wamp with php 5.3.

Thanks.

C

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: showstopper (---.rev.greendottt.net)
Date: July 15, 2010 06:56AM

you can try this for eg if php is in c:/php run the following command
 cd c:\php 

php -v

and it will out put some php info

Fitcom - Technology and SEO with a side of awesome

Installing and Configuring a WAMP Server in Windows 7 & 8

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: charlesblackwell412 (165.190.89.---)
Date: July 15, 2010 04:17PM

Showstopper,
Hi. This is what the output was when I did that:

C:\wamp\bin\php\php5.3.0>php -v
PHP 5.3.0 (cli) (built: Jun 29 2009 21:25:23)
Copyright (c) 1997-2009 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2009 Zend Technologies

What should I add to my path to make it work?

C

Options: ReplyQuote
Re: Running PHP from Windows XP command line interface
Posted by: charlesblackwell412 (165.190.89.---)
Date: July 15, 2010 05:13PM

Thanks! I got it to work. I forgot to put the ending slash on the path and now it working.

C

Options: ReplyQuote


Sorry, only registered users may post in this forum.