Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #16378 > unrolled thread

how use php -w command in localhost on win

Started byalex <alex@nomailno.it>
First post2016-02-11 14:50 +0100
Last post2016-02-12 22:51 -0500
Articles 20 on this page of 29 — 10 participants

Back to article view | Back to comp.lang.php


Contents

  how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-11 14:50 +0100
    Re: how use php -w command in localhost on win Erwin Moller <erwinmollerusenet@xs4all.nl> - 2016-02-11 16:56 +0100
      Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-11 17:19 +0100
        Re: how use php -w command in localhost on win Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2016-02-11 20:38 +0100
          Re: how use php -w command in localhost on win Tim Streater <timstreater@greenbee.net> - 2016-02-11 21:50 +0000
        Re: how use php -w command in localhost on win Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-11 14:45 -0500
          Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-12 10:42 +0100
            Re: how use php -w command in localhost on win Arno Welzel <usenet@arnowelzel.de> - 2016-02-12 10:45 +0100
              Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-12 11:36 +0100
                Re: how use php -w command in localhost on win Arno Welzel <usenet@arnowelzel.de> - 2016-02-12 13:38 +0100
                  Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-12 16:07 +0100
                    Re: how use php -w command in localhost on win "R.Wieser" <address@not.available> - 2016-02-12 16:31 +0100
                      Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-12 17:12 +0100
                        Re: how use php -w command in localhost on win "R.Wieser" <address@not.available> - 2016-02-12 18:28 +0100
                          Re: how use php -w command in localhost on win "A. Begarin" <andova.begarin@gmail.com> - 2016-02-12 18:24 -0800
                            Re: how use php -w command in localhost on win "R.Wieser" <address@not.available> - 2016-02-13 10:18 +0100
                    Re: how use php -w command in localhost on win "Christoph M. Becker" <cmbecker69@arcor.de> - 2016-02-12 21:41 +0100
                    Re: how use php -w command in localhost on win Arno Welzel <usenet@arnowelzel.de> - 2016-02-13 08:04 +0100
            Re: how use php -w command in localhost on win Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-12 09:57 -0500
    Re: how use php -w command in localhost on win Matthew Carter <m@ahungry.com> - 2016-02-11 21:29 -0500
    Re: how use php -w command in localhost on win Arno Welzel <usenet@arnowelzel.de> - 2016-02-12 09:04 +0100
    Re: how use php -w command in localhost on win "R.Wieser" <address@not.available> - 2016-02-12 10:20 +0100
      Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-12 10:43 +0100
        Re: how use php -w command in localhost on win Erwin Moller <erwinmollerusenet@xs4all.nl> - 2016-02-12 11:04 +0100
          Re: how use php -w command in localhost on win Erwin Moller <erwinmollerusenet@xs4all.nl> - 2016-02-12 11:08 +0100
            Re: how use php -w command in localhost on win alex <alex@nomailno.it> - 2016-02-12 11:41 +0100
    Re: how use php -w command in localhost on win "A. Begarin" <andova.begarin@gmail.com> - 2016-02-12 18:13 -0800
      Re: how use php -w command in localhost on win "A. Begarin" <andova.begarin@gmail.com> - 2016-02-12 18:19 -0800
        Re: how use php -w command in localhost on win Jerry Stuckle <jstucklex@attglobal.net> - 2016-02-12 22:51 -0500

Page 1 of 2  [1] 2  Next page →


#16378 — how use php -w command in localhost on win

Fromalex <alex@nomailno.it>
Date2016-02-11 14:50 +0100
Subjecthow use php -w command in localhost on win
Message-ID<n9i3jk$34b$1@gioia.aioe.org>
on WIn in localhost (LAMP)
how can use this command?

php -w file1.php > file2.php;

[toc] | [next] | [standalone]


#16379

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2016-02-11 16:56 +0100
Message-ID<56bcaf21$0$23758$e4fe514c@news.xs4all.nl>
In reply to#16378
On 2/11/2016 2:50 PM, alex wrote:
> on WIn in localhost (LAMP)
> how can use this command?
>
> php -w file1.php > file2.php;

LAMP on Win?

Could you elaborate a little more?

-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#16380

Fromalex <alex@nomailno.it>
Date2016-02-11 17:19 +0100
Message-ID<n9ic9j$ju1$1@gioia.aioe.org>
In reply to#16379
Il 11/02/2016 16:56, Erwin Moller ha scritto:
> On 2/11/2016 2:50 PM, alex wrote:
>> on WIn in localhost (LAMP)
>> how can use this command?
>>
>> php -w file1.php > file2.php;
>
> LAMP on Win?
>
> Could you elaborate a little more?
>
xampp for use php on windows

[toc] | [prev] | [next] | [standalone]


#16381

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2016-02-11 20:38 +0100
Message-ID<12467767.x6KakCpiVr@PointedEars.de>
In reply to#16380
alex <alex@nomailno.it> wrote:
^^^^
Please append your last name in the settings, Alex #74656, and specify a 
proper e-mail address if you desire a solution to your PHP problem(s).

If you are concerned about spam, you can use a proper e-mail address there, 
specifying a mailbox that you read seldom, and an e-mail address for a 
mailbox that you read regularly in the Reply-To header field.  Everything
is better than your present approach.

<http://www.interhack.net/pubs/munging-harmful/>

F'up2 poster

-- 
PointedEars
Zend Certified PHP Engineer 
<http://www.zend.com/en/yellow-pages/ZEND024953> | Twitter: @PointedEars2
Please do not cc me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#16383

FromTim Streater <timstreater@greenbee.net>
Date2016-02-11 21:50 +0000
Message-ID<110220162150478611%timstreater@greenbee.net>
In reply to#16381
In article <12467767.x6KakCpiVr@PointedEars.de>, Thomas 'PointedEars'
Lahn <PointedEars@web.de> wrote:

>alex <alex@nomailno.it> wrote:
>^^^^
>Please append your last name in the settings, Alex #74656, and specify a 
>proper e-mail address if you desire a solution to your PHP problem(s).

Alex - pay no attention to this nonsense from PointyHead.

Meanwhile, you may need to provide more information about your question.

-- 
New Socialism consists essentially in being seen to have your heart in 
the right place whilst your head is in the clouds and your hand is in 
someone else's pocket.

[toc] | [prev] | [next] | [standalone]


#16382

FromJerry Stuckle <jstucklex@attglobal.net>
Date2016-02-11 14:45 -0500
Message-ID<n9io6s$3th$1@jstuckle.eternal-september.org>
In reply to#16380
On 2/11/2016 11:19 AM, alex wrote:
> Il 11/02/2016 16:56, Erwin Moller ha scritto:
>> On 2/11/2016 2:50 PM, alex wrote:
>>> on WIn in localhost (LAMP)
>>> how can use this command?
>>>
>>> php -w file1.php > file2.php;
>>
>> LAMP on Win?
>>
>> Could you elaborate a little more?
>>
> xampp for use php on windows

Alex,

First of all, don't worry about "Pointed Head".  He's a well-known troll
who never contributes anything worthwhile to this or other newsgroups.
But he expects everyone to follow HIS rules on how to post to Usenet.
He's not worth it.

As for your question - Erwin asked because LAMP is Linux (Apache, MySQL,
PHP), not Windows.

But your problem is not clear.  That is a valid command; what trouble
are you having with it?

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#16387

Fromalex <alex@nomailno.it>
Date2016-02-12 10:42 +0100
Message-ID<n9k9d7$1gcf$1@gioia.aioe.org>
In reply to#16382
Il 11/02/2016 20:45, Jerry Stuckle ha scritto:
> On 2/11/2016 11:19 AM, alex wrote:
>> Il 11/02/2016 16:56, Erwin Moller ha scritto:
>>> On 2/11/2016 2:50 PM, alex wrote:
>>>> on WIn in localhost (LAMP)
>>>> how can use this command?
>>>>
>>>> php -w file1.php > file2.php;
>>>
>>> LAMP on Win?
>>>
>>> Could you elaborate a little more?
>>>
>> xampp for use php on windows
>
> Alex,
>
> First of all, don't worry about "Pointed Head".  He's a well-known troll
> who never contributes anything worthwhile to this or other newsgroups.
> But he expects everyone to follow HIS rules on how to post to Usenet.
> He's not worth it.

ok

> As for your question - Erwin asked because LAMP is Linux (Apache, MySQL,
> PHP), not Windows.

ok, in effect I use not LAMP  but WAMP


> But your problem is not clear.  That is a valid command; what trouble
> are you having with it?
I use wamp software for to develop php code under windows;
so not know how I can use the command php -w;

tested also this:
I created a file test.php with this code
exec("php -w file1.php > file2.php;");

where inner the file1.php have some php code;

when I open the test.php file the command exec start,
the file2.php is created but is void (instead should to be how the file1 
with no spaces and comments);








[toc] | [prev] | [next] | [standalone]


#16389

FromArno Welzel <usenet@arnowelzel.de>
Date2016-02-12 10:45 +0100
Message-ID<56BDA9B3.3040102@arnowelzel.de>
In reply to#16387
alex schrieb am 2016-02-12 um 10:42:

[...]
> I use wamp software for to develop php code under windows;
> so not know how I can use the command php -w;
> 
> tested also this:
> I created a file test.php with this code
> exec("php -w file1.php > file2.php;");

And the full path to php.exe is in the PATH environment variable of
Windows? Otherwise exec() will not know how to start php.



-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

[toc] | [prev] | [next] | [standalone]


#16392

Fromalex <alex@nomailno.it>
Date2016-02-12 11:36 +0100
Message-ID<n9kcjd$1n3o$1@gioia.aioe.org>
In reply to#16389
Il 12/02/2016 10:45, Arno Welzel ha scritto:
> alex schrieb am 2016-02-12 um 10:42:
>
> [...]
>> I use wamp software for to develop php code under windows;
>> so not know how I can use the command php -w;
>>
>> tested also this:
>> I created a file test.php with this code
>> exec("php -w file1.php > file2.php;");
>
> And the full path to php.exe is in the PATH environment variable of
> Windows? Otherwise exec() will not know how to start php.
ok thanks for the suggestion;
I done so:
inner the folder www I copyed the file php.exe and php5t.dll taken from 
folder php; and ok work

[toc] | [prev] | [next] | [standalone]


#16394

FromArno Welzel <usenet@arnowelzel.de>
Date2016-02-12 13:38 +0100
Message-ID<56BDD249.9070604@arnowelzel.de>
In reply to#16392
alex schrieb am 2016-02-12 um 11:36:

> Il 12/02/2016 10:45, Arno Welzel ha scritto:
>> alex schrieb am 2016-02-12 um 10:42:
>>
>> [...]
>>> I use wamp software for to develop php code under windows;
>>> so not know how I can use the command php -w;
>>>
>>> tested also this:
>>> I created a file test.php with this code
>>> exec("php -w file1.php > file2.php;");
>>
>> And the full path to php.exe is in the PATH environment variable of
>> Windows? Otherwise exec() will not know how to start php.
> ok thanks for the suggestion;
> I done so:
> inner the folder www I copyed the file php.exe and php5t.dll taken from 
> folder php; and ok work

This is an ugly hack you should avoid.

Just add the folder where php.exe is to the PATH variable so you can use
"php" as a command everywhere.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

[toc] | [prev] | [next] | [standalone]


#16396

Fromalex <alex@nomailno.it>
Date2016-02-12 16:07 +0100
Message-ID<n9ksfq$10js$1@gioia.aioe.org>
In reply to#16394
Il 12/02/2016 13:38, Arno Welzel ha scritto:
> alex schrieb am 2016-02-12 um 11:36:
>
>> Il 12/02/2016 10:45, Arno Welzel ha scritto:
>>> alex schrieb am 2016-02-12 um 10:42:
>>>
>>> [...]
>>>> I use wamp software for to develop php code under windows;
>>>> so not know how I can use the command php -w;
>>>>
>>>> tested also this:
>>>> I created a file test.php with this code
>>>> exec("php -w file1.php > file2.php;");
>>>
>>> And the full path to php.exe is in the PATH environment variable of
>>> Windows? Otherwise exec() will not know how to start php.
>> ok thanks for the suggestion;
>> I done so:
>> inner the folder www I copyed the file php.exe and php5t.dll taken from
>> folder php; and ok work
>
> This is an ugly hack you should avoid.
>
> Just add the folder where php.exe is to the PATH variable so you can use
> "php" as a command everywhere.

ok
if the file test.php with exec command is here C:\XAMP\www\
and the php.exe here:C:\XAMP\php\ is mandatory to use the absolute path?
exec("C:\XAMP\php\php -w file1.php > file2.php;");
how can use relative path?

[toc] | [prev] | [next] | [standalone]


#16397

From"R.Wieser" <address@not.available>
Date2016-02-12 16:31 +0100
Message-ID<56bdfa12$0$23750$e4fe514c@news.xs4all.nl>
In reply to#16396
Alex,

> how can use relative path?

That is a question that can only be answered if-and-when you know where the
"exec( )" command executes the line you gave it.

(Perhaps doing an 'exec("dir > test.out")' and than check the folder
mentioned in that result file? )

.. And thats assuming it always executes it from the same path.

Regards,
Rudy Wieser


-- Origional message:
alex <alex@nomailno.it> schreef in berichtnieuws
n9ksfq$10js$1@gioia.aioe.org...
> Il 12/02/2016 13:38, Arno Welzel ha scritto:
> > alex schrieb am 2016-02-12 um 11:36:
> >
> >> Il 12/02/2016 10:45, Arno Welzel ha scritto:
> >>> alex schrieb am 2016-02-12 um 10:42:
> >>>
> >>> [...]
> >>>> I use wamp software for to develop php code under windows;
> >>>> so not know how I can use the command php -w;
> >>>>
> >>>> tested also this:
> >>>> I created a file test.php with this code
> >>>> exec("php -w file1.php > file2.php;");
> >>>
> >>> And the full path to php.exe is in the PATH environment variable of
> >>> Windows? Otherwise exec() will not know how to start php.
> >> ok thanks for the suggestion;
> >> I done so:
> >> inner the folder www I copyed the file php.exe and php5t.dll taken from
> >> folder php; and ok work
> >
> > This is an ugly hack you should avoid.
> >
> > Just add the folder where php.exe is to the PATH variable so you can use
> > "php" as a command everywhere.
>
> ok
> if the file test.php with exec command is here C:\XAMP\www\
> and the php.exe here:C:\XAMP\php\ is mandatory to use the absolute path?
> exec("C:\XAMP\php\php -w file1.php > file2.php;");
> how can use relative path?

[toc] | [prev] | [next] | [standalone]


#16398

Fromalex <alex@nomailno.it>
Date2016-02-12 17:12 +0100
Message-ID<n9l08r$17s0$1@gioia.aioe.org>
In reply to#16397
Il 12/02/2016 16:31, R.Wieser ha scritto:
>> how can use relative path?
> That is a question that can only be answered if-and-when you know where the
> "exec( )" command executes the line you gave it.
>
> (Perhaps doing an 'exec("dir > test.out")' and than check the folder
> mentioned in that result file? )
>
> .. And thats assuming it always executes it from the same path.


the file test.php with exec command is here
C:\XAMP\www\
and the php.exe here:
C:\XAMP\php\

code relative
C
  \XAMP\www\ code from here
  \XAMP\php\ call this

absolute ok
exec("C:\XAMP\php\php -w file1.php > file2.php;");

relative something like this?
exec("..\php\php -w file1.php > file2.php;");
but not remember exactly how

[toc] | [prev] | [next] | [standalone]


#16400

From"R.Wieser" <address@not.available>
Date2016-02-12 18:28 +0100
Message-ID<56be1650$0$23867$e4fe514c@news.xs4all.nl>
In reply to#16398
Alex,

> the file test.php with exec command is here
> C:\XAMP\www\
> and the php.exe here:
> C:\XAMP\php\

Neither of those tell you which folder the "exec" command uses as *its* base
folder.  And *that* is what you need to find out.   It might first switch to
the folder the "php.exe" executable is in, but it might also not.

In other words: its anyones guess what that "exec" command does ...

> relative something like this?
> exec("..\php\php -w file1.php > file2.php;");

Yes, thats how you do it: By *not* starting with a drive-letter and/or a
blackslash.

-- Absolute paths
C:\folder1\file.ext
\Folder2\file.ext

The last one is special, in so far that its *relative* in which drive it
uses, but *absolute* in regard to the path itself (the first one is absolute
in both regards).

-- Relative paths
file.ext
.\file.ext
..\file.ext
folder1\\file.ext
..\folder2\file.ext
.\folder1\file.ext

Remark: The ones starting with ".\" are special.  It means "this, the
current folder".   ".\file.ext" is normally the same as "file.ext" You will
not often use it, but *sometimes* its handy.

Regards,
Rudy Wieser


-- Origional message:
alex <alex@nomailno.it> schreef in berichtnieuws
n9l08r$17s0$1@gioia.aioe.org...
> Il 12/02/2016 16:31, R.Wieser ha scritto:
> >> how can use relative path?
> > That is a question that can only be answered if-and-when you know where
the
> > "exec( )" command executes the line you gave it.
> >
> > (Perhaps doing an 'exec("dir > test.out")' and than check the folder
> > mentioned in that result file? )
> >
> > .. And thats assuming it always executes it from the same path.
>
>
> the file test.php with exec command is here
> C:\XAMP\www\
> and the php.exe here:
> C:\XAMP\php\
>
> code relative
> C
>   \XAMP\www\ code from here
>   \XAMP\php\ call this
>
> absolute ok
> exec("C:\XAMP\php\php -w file1.php > file2.php;");
>
> relative something like this?
> exec("..\php\php -w file1.php > file2.php;");
> but not remember exactly how

[toc] | [prev] | [next] | [standalone]


#16406

From"A. Begarin" <andova.begarin@gmail.com>
Date2016-02-12 18:24 -0800
Message-ID<b44b1fdb-c4b3-4152-b27e-7ca1cafc7589@googlegroups.com>
In reply to#16400
> In other words: its anyones guess what that "exec" command does ... 

PHP determines what exec does. Completely and utterly. One can consider the underlying Operating Systems's PATH as "influencing PHP" here, but that's almost beside the point.

[toc] | [prev] | [next] | [standalone]


#16409

From"R.Wieser" <address@not.available>
Date2016-02-13 10:18 +0100
Message-ID<56bef4fe$0$23809$e4fe514c@news.xs4all.nl>
In reply to#16406
A. Begarin,

> PHP determines what exec does.

Absolutily.

But its a statement as meaningfull as saying "water is wet".    Either the
PHP program implements that "exec" command, or it does exist to begin with.

Too me it looks you either know something you're not willing to tell the OP
(like where this "base path" behaviour for that "exec" command is
specified), or you have not really understood my explanation to the OP's
problem ...

Regards,
Rudy Wieser


-- Origional message:
A. Begarin <andova.begarin@gmail.com> schreef in berichtnieuws
b44b1fdb-c4b3-4152-b27e-7ca1cafc7589@googlegroups.com...
> > In other words: its anyones guess what that "exec" command does ...
>
> PHP determines what exec does. Completely and utterly. One can consider
the underlying Operating Systems's PATH as "influencing PHP" here, but
that's almost beside the point.


[toc] | [prev] | [next] | [standalone]


#16401

From"Christoph M. Becker" <cmbecker69@arcor.de>
Date2016-02-12 21:41 +0100
Message-ID<n9lg1u$3ke$1@solani.org>
In reply to#16396
alex wrote:

> Il 12/02/2016 13:38, Arno Welzel ha scritto:
>
>> alex schrieb am 2016-02-12 um 11:36:
>>
>>> Il 12/02/2016 10:45, Arno Welzel ha scritto:
>>>
>>>> alex schrieb am 2016-02-12 um 10:42:
>>>>
>>>>> I use wamp software for to develop php code under windows;
            ^^^^

> if the file test.php with exec command is here C:\XAMP\www\
                                                    ^^^^
> and the php.exe here:C:\XAMP\php\ is mandatory to use the absolute path?
                          ^^^^

Apparently, you use XAMPP, BTW.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#16408

FromArno Welzel <usenet@arnowelzel.de>
Date2016-02-13 08:04 +0100
Message-ID<56BED57F.3020800@arnowelzel.de>
In reply to#16396
alex schrieb am 2016-02-12 um 16:07:

> Il 12/02/2016 13:38, Arno Welzel ha scritto:
>> alex schrieb am 2016-02-12 um 11:36:
>>
>>> Il 12/02/2016 10:45, Arno Welzel ha scritto:
>>>> alex schrieb am 2016-02-12 um 10:42:
>>>>
>>>> [...]
>>>>> I use wamp software for to develop php code under windows;
>>>>> so not know how I can use the command php -w;
>>>>>
>>>>> tested also this:
>>>>> I created a file test.php with this code
>>>>> exec("php -w file1.php > file2.php;");
>>>>
>>>> And the full path to php.exe is in the PATH environment variable of
>>>> Windows? Otherwise exec() will not know how to start php.
>>> ok thanks for the suggestion;
>>> I done so:
>>> inner the folder www I copyed the file php.exe and php5t.dll taken from
>>> folder php; and ok work
>>
>> This is an ugly hack you should avoid.
>>
>> Just add the folder where php.exe is to the PATH variable so you can use
>> "php" as a command everywhere.
> 
> ok
> if the file test.php with exec command is here C:\XAMP\www\
> and the php.exe here:C:\XAMP\php\ is mandatory to use the absolute path?
> exec("C:\XAMP\php\php -w file1.php > file2.php;");
> how can use relative path?

You don't - just add C:\XAMP\php to the PATH variable of your system. Or
don't you know how to change the PATH setting?

Maybe this helps:

<http://www.computerhope.com/issues/ch000549.htm>


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de
http://fahrradzukunft.de

[toc] | [prev] | [next] | [standalone]


#16395

FromJerry Stuckle <jstucklex@attglobal.net>
Date2016-02-12 09:57 -0500
Message-ID<n9krn7$uf6$1@jstuckle.eternal-september.org>
In reply to#16387
On 2/12/2016 4:42 AM, alex wrote:
> Il 11/02/2016 20:45, Jerry Stuckle ha scritto:
>> On 2/11/2016 11:19 AM, alex wrote:
>>> Il 11/02/2016 16:56, Erwin Moller ha scritto:
>>>> On 2/11/2016 2:50 PM, alex wrote:
>>>>> on WIn in localhost (LAMP)
>>>>> how can use this command?
>>>>>
>>>>> php -w file1.php > file2.php;
>>>>
>>>> LAMP on Win?
>>>>
>>>> Could you elaborate a little more?
>>>>
>>> xampp for use php on windows
>>
>> Alex,
>>
>> First of all, don't worry about "Pointed Head".  He's a well-known troll
>> who never contributes anything worthwhile to this or other newsgroups.
>> But he expects everyone to follow HIS rules on how to post to Usenet.
>> He's not worth it.
> 
> ok
> 
>> As for your question - Erwin asked because LAMP is Linux (Apache, MySQL,
>> PHP), not Windows.
> 
> ok, in effect I use not LAMP  but WAMP
> 
> 
>> But your problem is not clear.  That is a valid command; what trouble
>> are you having with it?
> I use wamp software for to develop php code under windows;
> so not know how I can use the command php -w;
> 
> tested also this:
> I created a file test.php with this code
> exec("php -w file1.php > file2.php;");
> 
> where inner the file1.php have some php code;
> 
> when I open the test.php file the command exec start,
> the file2.php is created but is void (instead should to be how the file1
> with no spaces and comments);
> 

That doesn't work because the redirection character ('>') is handed by
the command processor cmd.exe.  You aren't using it when you use the
exec command.

There are several ways to handle this.  You can add the directory
containing php.exe to your PATH variable, as Arno indicated.  You need
administrator privileges to do this, and you need to be careful - if you
mess up, you can leave your system in an unusable condition.  So be
careful, save your current PATH before you change it, and test before
you reboot.

You can also place your php.exe file in a directory already in your
PATH. While this is easiest, you need to remember that you did it and
when you update PHP you need to copy the new copy of PHP to this directory.

One safe and easy way to do it is to create a .bat file in one of the
directories already in your PATH statement.  In that file you can add
the directory containing php.exe to your PATH statement temporarily; you
just have to run the .bat file once after opening the command prompt. It
could look something like:

@PATH=%PATH%;c:\program files\php

Where c:\program files\php would be the directory containing your
php.exe file.

Of course, you can always use the full path when executing your php
command, but that gets pretty tiring, pretty quickly.

Hope this gives you some ideas.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#16384

FromMatthew Carter <m@ahungry.com>
Date2016-02-11 21:29 -0500
Message-ID<87fuwy8xv2.fsf@ahungry.com>
In reply to#16378
alex <alex@nomailno.it> writes:

> on WIn in localhost (LAMP)
> how can use this command?
>
> php -w file1.php > file2.php;

Is your php command in your path?  If not you may need to try the full
path to the executable?

-- 
Matthew Carter (m@ahungry.com)
http://ahungry.com

[toc] | [prev] | [next] | [standalone]


Page 1 of 2  [1] 2  Next page →

Back to top | Article view | comp.lang.php


csiph-web