Date: 10/24/00
- Next message: adam <email protected>: "[PHP-DEV] PHP 4.0 Bug #7418: Mac WWW upload error FIX"
- Previous message: feng <email protected>: "[PHP-DEV] PHP 4.0 Bug #7440: Print function calling stack"
- Next in thread: Jorge Cisneros Flores: "[PHP-DEV] Re: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!"
- Maybe reply: Jorge Cisneros Flores: "[PHP-DEV] Re: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!"
- Reply: Joey Smith: "Re: [PHP-DEV] Re: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Bug Database wrote:
> ID: 7380
> Updated by: joey
> Reported By: jorge <email protected>
> Status: Closed
> Bug Type: Output Control
> Assigned To:
> Comments:
>
> Actually, try 2 slashes to escape the space.
>
> $cmd = "cat foo\\ bar";
>
> For a file named "foo bar"
>
> Previous Comments:
> ---------------------------------------------------------------------------
>
> [2000-10-22 22:28:03] lyric <email protected>
> Your problem is nothing to do with PHP. If you ran
>
> cat /home/test/test file.gif
>
> from the command prompt, it wouldn't work either. cat thinks you mean two files : "/home/test/test" and "file.gif"
>
> You need either to escape the space, or put quotes around your filename.
>
> Eg:
>
> passthru( 'cat /home/test/test file.gif' );
>
> passthru( 'cat "/home/test/test file.gif"' );
>
> ---------------------------------------------------------------------------
>
> [2000-10-22 22:23:56] chrisv <email protected>
> That's not a problem with the passthru() function- take this scenario:
>
> ------------------------------------------
>
> test <email protected>:/home/test$ cat test file.gif
>
> cat: test: No such file or directory
>
> cat: file.gif: No such file or directory
>
> test <email protected>:/home/test$ cat 'test file.gif'
>
> [insert gif file here]
>
> -----------------------------------------
>
> So, in the function --
>
> passthru("convert -scale 100x100 cat image.gif gif:-");
>
> the program convert is receiving the arguments:
>
> 0: convert
>
> 1: -scale
>
> 2: 100x100
>
> 3: cat
>
> 4: image.gif
>
> 5: gif:-
>
> passthru("convert -scale 100x100 'cat image.gif' gif:-");
>
> is most likely what you want.
>
> ---------------------------------------------------------------------------
>
> [2000-10-22 22:09:45] jorge <email protected>
> Hi.
>
> I believe that I don't explain to me well, I want to send an image to the
>
> navigator, my code in php works well if thefile that I want to show doesn't
>
> have any space for example in the name (cat.gif), but if the name of the
>
> image has a space (cat image.gif) the command doesn't make anything.
>
> Example.
>
> The following code converts an image using ImageMagic, the result is sent to output standar
>
> This code don't work
>
> <?
>
> Header("Content-type: image/gif");
>
> passthru("convert -scale 100x100 cat image.gif gif:-");
>
> ?>
>
> This code work fine
>
> <?
>
> Header("Content-type: image/gif");
>
> passthru("convert -scale 100x100 cat_image.gif gif:-");
>
> ?>
>
> ---------------------------------------------------------------------------
>
> [2000-10-21 18:46:00] lyric <email protected>
> This might be a dumb question, but you do know that you can't just "cat foo.gif" in the middle of a HTML file and expect it to produce an inline image, right?
>
> I've got two ideas:
>
> a) unless you change it, the content-type of the results from a php program is "text/html". Try adding
>
> Header("Content-type: image/gif");
>
> to the start of your PHP file
>
> b) the webserver hasn't got enough permissions to see the graphic? Try copying it to the same place as your php file, and typing "chmod 444 file.gif" to make it world-readable.
>
> The following code works perfectly for me:
>
> <?php
>
> Header("Content-type: image/gif");
>
> passthru("cat a.gif");
>
> ?>
>
> I suppose there's a reason you're using "cat foo.gif" rather than readfile()?
>
> ---------------------------------------------------------------------------
>
> [2000-10-21 01:41:25] jorge <email protected>
> the function don't return anything to the browser, the problem is when i run a program that need to open a file contained a spaces for example
>
> $cmd="cat /home/test/test file.gif";
>
> passthru($cmd);
>
> If you run this script the document is EMPTY
>
> I try the follow comands without results
>
> $cmd="cat "/home/test/test file.gif"";
>
> $cmd="cat /home/test/test file.gif";
>
> Please help me
>
> ---------------------------------------------------------------------------
>
> The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online.
>
> Full Bug description available at: http://bugs.php.net/?id=7380
Update, the problem is when i Run the PHP in the safe mode.
-- PHP Development Mailing List <http://www.php.net/> To unsubscribe, e-mail: php-dev-unsubscribe <email protected> For additional commands, e-mail: php-dev-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: adam <email protected>: "[PHP-DEV] PHP 4.0 Bug #7418: Mac WWW upload error FIX"
- Previous message: feng <email protected>: "[PHP-DEV] PHP 4.0 Bug #7440: Print function calling stack"
- Next in thread: Jorge Cisneros Flores: "[PHP-DEV] Re: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!"
- Maybe reply: Jorge Cisneros Flores: "[PHP-DEV] Re: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!"
- Reply: Joey Smith: "Re: [PHP-DEV] Re: PHP 4.0 Bug #7380 Updated: the function passthru is bad!!!!!!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

