473,382 Members | 1,204 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

How to use php on the command line?

sam
Hi,
My question is how to use php on command line in windows

Jan 5 '07 #1
4 1563
sam wrote:
Hi,
My question is how to use php on command line in windows
Hi

Only php.exe will execute from commandline, not the sapi-variant.
First check if php.exe is added to the path by simply typing: path
Does it list the path to php.exe?
(If not add it, or go to the directory where php.exe is.)

Now type something like:
php -?

or

php myscript.php

Regards,
Erwin Moller

PS: Maybe you need the file php-win.exe instead of php.exe, not sure. I
seldom use PHP commandline.
Jan 5 '07 #2
sam
Hi,
But when i started php.exe through commaind line it give me the black
screen
and the error showing on it is:
Unable to load /.php_gd2.dll file
What this line means please tell me how i configure it or where I can
find this dll file?

Jan 5 '07 #3
sam wrote:
Hi,
But when i started php.exe through commaind line it give me the black
screen
and the error showing on it is:
Unable to load /.php_gd2.dll file
What this line means please tell me how i configure it or where I can
find this dll file?
Hi,

That file is the graphcislib of PHP, named GD-lib (version 2 in your case,
which is good).

I expect that you did comment out in php.ini this extension, so PHP tries to
load it, but cannot find it.

But it is hard to help you based on the limitted information you provided.
Some thoughts:

Do you have a good reason to run PHP from commandline?

What does php answer if you:
1) start->run-type cmd
2) cd to the directory of php.exe
3) type php -?
(gives some information on how to use it)
or 3) type php -v
(gives versionnumber)

The -? will also give you information on how to tell php which php.ini to
use.
Maybe make a fresh one for this application with the GD-libs commented out?

Regards,
Erwin Moller
Jan 5 '07 #4
On 5 Jan 2007 07:23:30 -0800, "sam" <sa********@yahoo.comwrote:
>But when i started php.exe through commaind line it give me the black
screen
and the error showing on it is:
Unable to load /.php_gd2.dll file
What is the actual error? This looks like you've seen the error but
inaccurately retyped it; it's not worded quite like that.

Is it:

PHP Warning: PHP Startup: Unable to load dynamic library '.\php_gd2.dll' - The
specified module could not be found.
>What this line means please tell me how i configure it or where I can
find this dll file?
The most likely cause is that you need to set extension_dir in php.ini to
point to the "ext" directory in your PHP installation, as it's currently set to
"." rather than the full path.

--
Andy Hassall :: an**@andyh.co.uk :: http://www.andyh.co.uk
http://www.andyhsoftware.co.uk/space :: disk and FTP usage analysis tool
Jan 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Joe | last post by:
I'm using Python 2.4 on Windows XP SP2. I'm trying to receive a command line argument that is a newline (\n) Here is the command line to use sample.py "\n" Here is a sample.py script
7
by: Steve M | last post by:
I'm trying to invoke a Java command-line program from my Python program on Windows XP. I cannot get the paths in one of the arguments to work right. The instructions for the program describe the...
4
by: lkrubner | last post by:
I'd like to write a PHP script to be used from the command line on a Unix machine. I'd like for the script to put together a string, turn it into a web page, print it, then return control the...
5
by: randyelliott | last post by:
Good Day, I have a MS Access (Access 2000 now upgraded to 2003) database that tracks customer information. One function of this database is to create an encrypted license file for our software,...
34
by: Roman Mashak | last post by:
Hello, All! I'm implementing simple CLI (flat model, no tree-style menu etc.). Command line looks like this: <command> <param1> <param2> ... <paramN> (where N=1..4) And idea is pretty simple: ...
3
by: Double Echo | last post by:
Hi all, I'm using PHP 4.4.2, and use PHP on both the command-line and the web. I am running PHP on SuSE 10 Linux , in a VMware 5.5 workstation, using Apache 2.0.55 , on my Dell laptop. ...
4
by: Bit byte | last post by:
I have a project that I normally build (without problems) from the DevStudio IDE. However, I have embarked on automating all my builds (this test project being one of several). The project...
2
by: Jim | last post by:
Hello, I need a program that will traverse a directory tree to ensure that there are unix-style line endings on every file in that tree that is a text file. To tell text files from others I...
51
by: Ojas | last post by:
Hi!, I just out of curiosity want to know how top detect the client side application under which the script is getting run. I mean to ask the how to know whether the script is running under...
7
by: Jwe | last post by:
Hi, I've written a program which has both a command line interface and Windows form interface, however it isn't quite working correctly. When run from command line with no arguments it should...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.