Re: [PHP] Re: Problems with exec() on windows

2009-03-20 Thread Kyohere Luke
You might have something there - never really thought about how windows
forms the 8.3 names...  not many resources online about it ...

The actual path is c:\Program File\Gammu 1.23.91\bin\gammu.exe
I'd used c:\Progra~1\Gammu~1\bin\gammu.exe

Luke

On Thu, Mar 19, 2009 at 8:57 PM, Shawn McKenzie nos...@mckenzies.netwrote:

 Kyohere Luke wrote:
  Hi,
 
  Tried all that - it'd work well until one of the arguments also had
 spaces
  and thus had  or '' encapsulating it - this weirdness is the reason for
  this post.
  Shawn, even the good old C:\pathwi~1\gammu.exe failed :-(

 Well, you didn't do it properly then.  What is the actual path?

 
  The only way I've gotten it to work was to get rid of the spaces in the
  path/to/exe.
 
  Luke.
 
  On Thu, Mar 19, 2009 at 8:24 PM, bruce bedoug...@earthlink.net wrote:
 
  hey...
 
  if you're going to deal with file/pathnames in windows/linux.. you're
 going
  to have to encapsulate them with  or with '' ie double/single
 quotes...
 
 
 
  -Original Message-
  From: Kyohere Luke [mailto:l...@beyonic.com]
  Sent: Thursday, March 19, 2009 10:18 AM
  To: Bastien Koert
  Cc: Shawn McKenzie; php-general@lists.php.net
  Subject: Re: [PHP] Re: Problems with exec() on windows
 
 
  Eventually settled for getting rid of the spaces in the path. That
 worked.
  Thanks.
  Luke
 
  On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert phps...@gmail.com
 wrote:
 
 
  On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke l...@beyonic.com
 wrote:
 
  Thanks, but I tried this. Doesn't work because the path\to\gammu.exe
 has
  spaces in it
  Haliphax, thanks for your comments. I tried escapeshellarg() to no
 end.
 
  I'm exploring your reply regarding proc_open, but how exactly does
  proc_open
  separate the arguments from the command?
 
  Unless i'm mistaken, data written to the process's stdin (for the
 other
  process) is not treated like an argument.
 
  If I add the arguments to the process name/path? I'm back to square
 one.
 
  Luke.
 
  On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.net
  wrote:
  Kyohere Luke wrote:
  Hi,
  I'm trying to use exec to call gammu.exe and send sms on windows XP.
 
  This works from commandline:
 
  C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
 
  But if I run it through php like this:
 
  $command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
  test2\.;
  @exec($command, $response, $retval);
 
  This always fails, returns 1 and the response is empty.
 
  If the last argument is a string with no spaces, and the double
  quotes
  were
  omitted, it works perfectly.
 
  If the double quotes are added around the string with no spaces, it
  fails
  again, which makes me believe that the problem is with the double
  quotes.
  I've used procmon and it shows that when the double quotes are added
  around
  the last argument, gammu.exe is not even called at all.
 
  Problem is that the double quotes are required by gammu to send an
  sms
  with
  spaces in it.
 
  Any ideas? :-(
 
  Luke
 
  Why not try:
 
  $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1
  test2';
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 
  try double slashes for the path and wrap the pathin quotes if there are
  spaces in it. Or if possible get rid of the spaces in the folder names
 
  --
 
  Bastien
 
  Cat, the other other white meat
 
 
 


 --
 Thanks!
 -Shawn
 http://www.spidean.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Hi,
I'm trying to use exec to call gammu.exe and send sms on windows XP.

This works from commandline:

C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2

But if I run it through php like this:

$command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
test2\.;
@exec($command, $response, $retval);

This always fails, returns 1 and the response is empty.

If the last argument is a string with no spaces, and the double quotes were
omitted, it works perfectly.

If the double quotes are added around the string with no spaces, it fails
again, which makes me believe that the problem is with the double quotes.

I've used procmon and it shows that when the double quotes are added around
the last argument, gammu.exe is not even called at all.

Problem is that the double quotes are required by gammu to send an sms with
spaces in it.

Any ideas? :-(

Luke


Re: [PHP] Re: Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
spaces in it
Haliphax, thanks for your comments. I tried escapeshellarg() to no end.

I'm exploring your reply regarding proc_open, but how exactly does proc_open
separate the arguments from the command?

Unless i'm mistaken, data written to the process's stdin (for the other
process) is not treated like an argument.

If I add the arguments to the process name/path? I'm back to square one.

Luke.

On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.netwrote:

 Kyohere Luke wrote:
  Hi,
  I'm trying to use exec to call gammu.exe and send sms on windows XP.
 
  This works from commandline:
 
  C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
 
  But if I run it through php like this:
 
  $command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
  test2\.;
  @exec($command, $response, $retval);
 
  This always fails, returns 1 and the response is empty.
 
  If the last argument is a string with no spaces, and the double quotes
 were
  omitted, it works perfectly.
 
  If the double quotes are added around the string with no spaces, it fails
  again, which makes me believe that the problem is with the double quotes.
 
  I've used procmon and it shows that when the double quotes are added
 around
  the last argument, gammu.exe is not even called at all.
 
  Problem is that the double quotes are required by gammu to send an sms
 with
  spaces in it.
 
  Any ideas? :-(
 
  Luke
 

 Why not try:

 $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1 test2';

 --
 Thanks!
 -Shawn
 http://www.spidean.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
spaces in it
Haliphax, thanks for your comments. I tried escapeshellarg() to no end.

I'm exploring your reply regarding proc_open, but how exactly does proc_open
separate the arguments from the command?

Unless i'm mistaken, data written to the process's stdin (for the other
process) is not treated like an argument.

If I add the arguments to the process name/path? I'm back to square one.

Luke

On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.netwrote:

 Kyohere Luke wrote:
  Hi,
  I'm trying to use exec to call gammu.exe and send sms on windows XP.
 
  This works from commandline:
 
  C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
 
  But if I run it through php like this:
 
  $command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
  test2\.;
  @exec($command, $response, $retval);
 
  This always fails, returns 1 and the response is empty.
 
  If the last argument is a string with no spaces, and the double quotes
 were
  omitted, it works perfectly.
 
  If the double quotes are added around the string with no spaces, it fails
  again, which makes me believe that the problem is with the double quotes.
 
  I've used procmon and it shows that when the double quotes are added
 around
  the last argument, gammu.exe is not even called at all.
 
  Problem is that the double quotes are required by gammu to send an sms
 with
  spaces in it.
 
  Any ideas? :-(
 
  Luke
 

 Why not try:

 $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1 test2';

 --
 Thanks!
 -Shawn
 http://www.spidean.com

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] Re: Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Eventually settled for getting rid of the spaces in the path. That worked.
Thanks.
Luke

On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert phps...@gmail.com wrote:



 On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke l...@beyonic.com wrote:

 Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
 spaces in it
 Haliphax, thanks for your comments. I tried escapeshellarg() to no end.

 I'm exploring your reply regarding proc_open, but how exactly does
 proc_open
 separate the arguments from the command?

 Unless i'm mistaken, data written to the process's stdin (for the other
 process) is not treated like an argument.

 If I add the arguments to the process name/path? I'm back to square one.

 Luke.

 On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.net
 wrote:

  Kyohere Luke wrote:
   Hi,
   I'm trying to use exec to call gammu.exe and send sms on windows XP.
  
   This works from commandline:
  
   C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
  
   But if I run it through php like this:
  
   $command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
   test2\.;
   @exec($command, $response, $retval);
  
   This always fails, returns 1 and the response is empty.
  
   If the last argument is a string with no spaces, and the double quotes
  were
   omitted, it works perfectly.
  
   If the double quotes are added around the string with no spaces, it
 fails
   again, which makes me believe that the problem is with the double
 quotes.
  
   I've used procmon and it shows that when the double quotes are added
  around
   the last argument, gammu.exe is not even called at all.
  
   Problem is that the double quotes are required by gammu to send an sms
  with
   spaces in it.
  
   Any ideas? :-(
  
   Luke
  
 
  Why not try:
 
  $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1 test2';
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 try double slashes for the path and wrap the pathin quotes if there are
 spaces in it. Or if possible get rid of the spaces in the folder names

 --

 Bastien

 Cat, the other other white meat



Re: [PHP] Re: Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Eventually settled for getting rid of the spaces in the path. That worked.
Thanks.
Luke

On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert phps...@gmail.com wrote:



 On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke l...@beyonic.com wrote:

 Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
 spaces in it
 Haliphax, thanks for your comments. I tried escapeshellarg() to no end.

 I'm exploring your reply regarding proc_open, but how exactly does
 proc_open
 separate the arguments from the command?

 Unless i'm mistaken, data written to the process's stdin (for the other
 process) is not treated like an argument.

 If I add the arguments to the process name/path? I'm back to square one.

 Luke.

 On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.net
 wrote:

  Kyohere Luke wrote:
   Hi,
   I'm trying to use exec to call gammu.exe and send sms on windows XP.
  
   This works from commandline:
  
   C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
  
   But if I run it through php like this:
  
   $command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
   test2\.;
   @exec($command, $response, $retval);
  
   This always fails, returns 1 and the response is empty.
  
   If the last argument is a string with no spaces, and the double quotes
  were
   omitted, it works perfectly.
  
   If the double quotes are added around the string with no spaces, it
 fails
   again, which makes me believe that the problem is with the double
 quotes.
  
   I've used procmon and it shows that when the double quotes are added
  around
   the last argument, gammu.exe is not even called at all.
  
   Problem is that the double quotes are required by gammu to send an sms
  with
   spaces in it.
  
   Any ideas? :-(
  
   Luke
  
 
  Why not try:
 
  $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1 test2';
 
  --
  Thanks!
  -Shawn
  http://www.spidean.com
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 


 try double slashes for the path and wrap the pathin quotes if there are
 spaces in it. Or if possible get rid of the spaces in the folder names

 --

 Bastien

 Cat, the other other white meat



Re: [PHP] Re: Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Hi,

Tried all that - it'd work well until one of the arguments also had spaces
and thus had  or '' encapsulating it - this weirdness is the reason for
this post.
Shawn, even the good old C:\pathwi~1\gammu.exe failed :-(

The only way I've gotten it to work was to get rid of the spaces in the
path/to/exe.

Luke.

On Thu, Mar 19, 2009 at 8:24 PM, bruce bedoug...@earthlink.net wrote:

 hey...

 if you're going to deal with file/pathnames in windows/linux.. you're going
 to have to encapsulate them with  or with '' ie double/single quotes...



 -Original Message-
 From: Kyohere Luke [mailto:l...@beyonic.com]
 Sent: Thursday, March 19, 2009 10:18 AM
 To: Bastien Koert
 Cc: Shawn McKenzie; php-general@lists.php.net
 Subject: Re: [PHP] Re: Problems with exec() on windows


 Eventually settled for getting rid of the spaces in the path. That worked.
 Thanks.
 Luke

 On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert phps...@gmail.com wrote:

 
 
  On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke l...@beyonic.com wrote:
 
  Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
  spaces in it
  Haliphax, thanks for your comments. I tried escapeshellarg() to no end.
 
  I'm exploring your reply regarding proc_open, but how exactly does
  proc_open
  separate the arguments from the command?
 
  Unless i'm mistaken, data written to the process's stdin (for the other
  process) is not treated like an argument.
 
  If I add the arguments to the process name/path? I'm back to square one.
 
  Luke.
 
  On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.net
  wrote:
 
   Kyohere Luke wrote:
Hi,
I'm trying to use exec to call gammu.exe and send sms on windows XP.
   
This works from commandline:
   
C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
   
But if I run it through php like this:
   
$command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
test2\.;
@exec($command, $response, $retval);
   
This always fails, returns 1 and the response is empty.
   
If the last argument is a string with no spaces, and the double
 quotes
   were
omitted, it works perfectly.
   
If the double quotes are added around the string with no spaces, it
  fails
again, which makes me believe that the problem is with the double
  quotes.
   
I've used procmon and it shows that when the double quotes are added
   around
the last argument, gammu.exe is not even called at all.
   
Problem is that the double quotes are required by gammu to send an
 sms
   with
spaces in it.
   
Any ideas? :-(
   
Luke
   
  
   Why not try:
  
   $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1
 test2';
  
   --
   Thanks!
   -Shawn
   http://www.spidean.com
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
  try double slashes for the path and wrap the pathin quotes if there are
  spaces in it. Or if possible get rid of the spaces in the folder names
 
  --
 
  Bastien
 
  Cat, the other other white meat
 




Re: [PHP] Re: Problems with exec() on windows

2009-03-19 Thread Kyohere Luke
Hi,

Tried all that - it'd work well until one of the arguments also had spaces
and thus had  or '' encapsulating it - this weirdness is the reason for
this post.
Shawn, even the good old C:\pathwi~1\gammu.exe failed :-(

The only way I've gotten it to work was to get rid of the spaces in the
path/to/exe.

Luke

On Thu, Mar 19, 2009 at 8:24 PM, bruce bedoug...@earthlink.net wrote:

 hey...

 if you're going to deal with file/pathnames in windows/linux.. you're going
 to have to encapsulate them with  or with '' ie double/single quotes...



 -Original Message-
 From: Kyohere Luke [mailto:l...@beyonic.com]
 Sent: Thursday, March 19, 2009 10:18 AM
 To: Bastien Koert
 Cc: Shawn McKenzie; php-general@lists.php.net
 Subject: Re: [PHP] Re: Problems with exec() on windows


 Eventually settled for getting rid of the spaces in the path. That worked.
 Thanks.
 Luke

 On Thu, Mar 19, 2009 at 8:06 PM, Bastien Koert phps...@gmail.com wrote:

 
 
  On Thu, Mar 19, 2009 at 12:48 PM, Kyohere Luke l...@beyonic.com wrote:
 
  Thanks, but I tried this. Doesn't work because the path\to\gammu.exe has
  spaces in it
  Haliphax, thanks for your comments. I tried escapeshellarg() to no end.
 
  I'm exploring your reply regarding proc_open, but how exactly does
  proc_open
  separate the arguments from the command?
 
  Unless i'm mistaken, data written to the process's stdin (for the other
  process) is not treated like an argument.
 
  If I add the arguments to the process name/path? I'm back to square one.
 
  Luke.
 
  On Thu, Mar 19, 2009 at 6:25 PM, Shawn McKenzie nos...@mckenzies.net
  wrote:
 
   Kyohere Luke wrote:
Hi,
I'm trying to use exec to call gammu.exe and send sms on windows XP.
   
This works from commandline:
   
C:\path\to\gammu.exe 1 --sendsms EMS 200 -text test1 test2
   
But if I run it through php like this:
   
$command = \C:\path\to\gammu.exe\ --sendsms EMS 200 -text \test1
test2\.;
@exec($command, $response, $retval);
   
This always fails, returns 1 and the response is empty.
   
If the last argument is a string with no spaces, and the double
 quotes
   were
omitted, it works perfectly.
   
If the double quotes are added around the string with no spaces, it
  fails
again, which makes me believe that the problem is with the double
  quotes.
   
I've used procmon and it shows that when the double quotes are added
   around
the last argument, gammu.exe is not even called at all.
   
Problem is that the double quotes are required by gammu to send an
 sms
   with
spaces in it.
   
Any ideas? :-(
   
Luke
   
  
   Why not try:
  
   $command = 'C:\path\to\gammu.exe --sendsms EMS 200 -text test1
 test2';
  
   --
   Thanks!
   -Shawn
   http://www.spidean.com
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  
  
 
 
  try double slashes for the path and wrap the pathin quotes if there are
  spaces in it. Or if possible get rid of the spaces in the folder names
 
  --
 
  Bastien
 
  Cat, the other other white meat
 




Re: [PHP] ruby / rails within a php site

2009-03-04 Thread Kyohere Luke
Would this work?

$contents = file_get_contents('
http://localhost/path_to_ruby_installation/rubyfile');
then print out the contents wherever you want to?

 or something similar, basically, we get the html output of the ruby file
over http, since this will run your ruby/rails installation the way it
expects to be run...

Thoughts?

Luke.

On Wed, Mar 4, 2009 at 9:02 AM, dg dane...@bluerodeo.com wrote:

 If it's html that Ruby generates, you could probably call that file as an
 include?

 Something like...

 $ruby = file_get_contents('rubyfile.html');

 then where ever in the document you want that content use:
 ?php print $ruby; ?- Show quoted text -


 On Mar 3, 2009, at 9:56 PM, ravi Ruddarraju wrote:

  I have a regular php site. I also have a ruby / rails application. Now I
 want to put the HTML generated by ruby / rails application within a div
 section of a php page. This should be similar to like calling a php
 function
 within a div section, which would produce the HTML output of the php
 function.
 Is such a thing possible between php and ruby / rails? Any help will be
 appreciated.

 Thanks
 ravi



 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] mysqli_embedded_server_start

2008-02-01 Thread Kyohere Luke
Providing an embedded web-server and php package, so embedded mysql would be
nice too.

There is absolutely no documentation regarding this function - isn't anyone
curious? :-)

On Feb 1, 2008 11:48 AM, Per Jessen [EMAIL PROTECTED] wrote:

 Robert Cummings wrote:

 
  On Fri, 2008-02-01 at 09:13 +0100, Per Jessen wrote:
  Kyohere Luke wrote:
 
   Has anyone tried to use this function? Does php actually support
   mysql embedded server or is this just a stub for future use? I'm
   trying to convert a mysql-based web app to a desktop app and rather
   than refactor everything to use sqlite, It would be interesting if
   I could use mysql embedded server.
 
  Alternatively, you could just run mysql locally on your desktop.
 
  Not so convenient for distribution :/

 Very true - but maybe Luke is already distributing PHP, a webserver etc?


 /Per Jessen, Zürich

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php




-- 
-- Luke Kyohere
-- /dev/null


[PHP] mysqli_embedded_server_start

2008-01-31 Thread Kyohere Luke
Hello,

Has anyone tried to use this function? Does php actually support mysql
embedded server or is this just a stub for future use? I'm trying to convert
a mysql-based web app to a desktop app and rather than refactor everything
to use sqlite, It would be interesting if I could use mysql embedded server.

Thanks!

-- 
-- Luke Kyohere
-- /dev/null