Question

I have 1 file php: C:\\Xml2InDesign\\InDesignTagConverter.php

I exe it by:

$sjis_cmd="php \"C:\\Xml2InDesign\\InDesignTagConverter.php\";
exec($sjis_cmd, $output);

It not working. What do i must setting?

I run from cmd:

php "C:\Xml2InDesign\InDesignTagConverter.php" "c:\work\link2\\tmp\\5699\\direction.xml" "c:\work\link2\\tmp\\5699\\tables"

Show error: 'php' is not recognized...

Was it helpful?

Solution

Find your php.exe path and run command from there.

Like if your php.exe is in C:\PHP5\php.exe , then you can execute like this

C:\PHP5\php.exe "C:\\Xml2InDesign\\InDesignTagConverter.php\"

Refer this link

OR

if you want to run it through php code then use exec command

OTHER TIPS

The PHP CLI as its called ( php for the Command Line Interface ) is called php.exe It lives in c:\wamp\bin\php\php5.x.y\php.exe ( where x and y are the version numbers of php that you have installed )

If you want to create php scrips to run from the command line that great its easy and very useful.

Create yourself a batch file like this, lets call it phppath.cmd :

PATH=%PATH%;c:\wamp\bin\php\php5.x.y php -v

Save this into one of your folders that is already on your PATH, so you can run it from anywhere.

Now from a command window, cd into your source folder and run >phppath.

Then run

php your_script.php
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top