You are here: Re: 'echo "": No such file or directory" error using "exec" to pipe in PHP script « All PHP « IT news, forums, messages
Re: 'echo "": No such file or directory" error using "exec" to pipe in PHP script

Posted by comp.lang.tcl on 12/01/06 22:33

Bryan Oakley wrote:
> comp.lang.tcl wrote:
> > Bryan Oakley wrote:
> >>Show us *precisely* what you type.
> >
> >
> > set php {<?
> > error_reporting(E_ALL & ~E_NOTICE);
> > $xml = preg_replace('/(>)[\\n\\r\\\s\\t]+(<)/', '$1$2',
> > $argv[1]); /* STRIP OUT WHITESPACE xml_parser_set_option() MIGHT MANGLE
> > XML */
> > $parser = @xml_parser_create();
> > @xml_parse_into_struct($parser, $xml, $xmlArray, $tags);
> > @xml_parser_free_parser($parser);
> > for ($i = 1; $i < @sizeof($xmlArray) - 1; $i++) \{
> > foreach ($xmlArray[$i]['attributes'] as $attr => $val)
> > $tclList .= $attr . ' \{' . str_replace('\{', '&#123;',
> > str_replace('\}', '&#125;', $val)) . '\} '; /* ESCAPED CURLY BRACES FOR
> > TCL LIST */
> > \}
> > echo trim($tclList);
> > ?>}
> >
> > global valPHPPath
> > if {![info exists valPHPPath]} {
> > if {![array exists env]} { global env }
> > source cgi_globals.tcl
> > global valPHPPath
> > }
> > set contentsList [exec $valPHPPath << $php]
> >
> >
> > -----------
> > There you go, exactly what I typed
> > -----------
> >
> > This is the error I get:
> >
> > Status: 404 X-Powered-By: PHP/4.4.4 Content-type: text/html No input
> > file specified. child process exited abnormally while executing "exec
> > $valPHPPath -q << $php" (procedure "XML_GET_ALL_ELEMENT_ATTRS" line 37)
>
> Strip out all the Tcl. All of it. Every last byte. Put the php into a
> file. Then, from a command line type "php /your/file.php"
>
> You will get the exact same error. The bug is in php, of which I know
> nothing about. What I do know is that the problem isn't Tcl.

No, sorry I get no error whatsoever, in fact, I get nothing. It's not
a PHP syntax or evaluation error, it's just that apparently it seems
$argv does not exist because it was never set with any values, so
putting it into a PHP file is ultimately meaningless because I can't
get the XML contents into the PHP file even if it were separate.

So again, at this point, you're right, this is not a TCL issue and
needs to be moved to a PHP issue.

Phil

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация