Questions tagged [passthru]

PHP Function to execute an external program and display raw output.

void passthru ( string $command [, int &$return_var ] )

The passthru() function is similar to the function in that it executes a command. This function should be used in place of or when the output from the Unix command is binary data which needs to be passed directly back to the browser.

87 questions
16
votes
1 answer

Powershell: how to implement standard switches?

For things like -WhatIf, we have $PSCmdlet.ShouldProcess() given to us by the [CmdletBinding] attribute. Are there other such tools or practices for implementing common command line arguments such as -Verbose, -Debug, -PassThru, etc?
bwerks
  • 8,031
  • 13
  • 61
  • 96
7
votes
4 answers

How to make a passthrough / passthru query editable?

In the Microsoft Access 2007 with an SQL Server Backend, we usually take a linked table from the SQL Server as Form.RecordSource of an editable form for a single table data modification. A local query is used for cross tables editions that combines…
jacouh
  • 7,369
  • 5
  • 25
  • 38
4
votes
4 answers

Passing data from C++ to PHP

I need to pass a value from PHP to C++. I think I can do with PHP's passthru() function. Then I want C++ to do something to that value and return the result to PHP. This is the bit I can't work out, does anyone know how to pass data from C++ to…
Columbo
  • 2,667
  • 7
  • 36
  • 51
3
votes
2 answers

How to pass the content of a variable trough an external command in php?

I have a variable that contains a long string. (specifically it contains a few kilobytes of javascript-code) I want to pass this string trough an external command, in this case a javascript-compressor, and capture the output of the external command…
Agrajag
  • 1,018
  • 2
  • 9
  • 23
3
votes
1 answer

Why is exec() silently discarding bytes?

After a lot of struggling, I found out some behavior I can't explain / solve, so asking here for help. On our server (Ubuntu 16.04.5 LTS with PHP 7.0.30), we're using some tools outside of the 'httpdocs', which are called using exec() to get their…
Bazardshoxer
  • 495
  • 1
  • 4
  • 19
3
votes
3 answers

PHP exec() not working - exiting early? no error?

i am using PHP to run exec() on a script which looks like this: exec("pdftk xx.pdf fill_form xx.fdf output xx.pdf flatten"); the strangest thing is that when i log in to ssh and put the command in manually - it works fine! it outputs a 224k pdf.…
dan
  • 97
  • 1
  • 1
  • 7
3
votes
1 answer

passthru() centos LD_LIBRARY_PATH

I am having troubles with the passthru() command when executing Java programs. More specifically with setting the LD_LIBRARY_PATH using passthru. I tried: setting the .so file path directly like this: passthru("java …
2
votes
2 answers

How to pass the string from php to tcl and execute the script

I want to pass the string from my php like And my tcl script set new [exec $str1]#str1 from php puts $new Is this Possible? Please let me know I'm stuck with this
sam
  • 53
  • 4
2
votes
0 answers

Omniauth, Devise, Rails, Facebook. Error: Not found. Authentication passthru

Evening - although this has come up in questions on here before, none of the solutions given fix this issue and believe I have covered most of the previous solutions. Basically, I am clicking on a 'sign up with facebook' link and getting the error…
sdawes
  • 361
  • 1
  • 4
  • 14
2
votes
2 answers

Can't find a Perl script from PHP/Apache

From a PHP script I want to run a Perl script. I can do this fine from the terminal (as root user) but when run from my application (www-data user) I can't. When developing the application on localhost I was able to do this fine as well, but the…
Lauragro
  • 21
  • 1
2
votes
1 answer

Use function call in passthrough query?

I have a passthrough query in an Access 2010 application, which I'm using to call a stored procedure on a SQL Server backend. The stored procedure takes a parameter that I need to make dynamic. The problem is this: Execute spMyProc 'userName' works…
nwhaught
  • 1,512
  • 15
  • 33
2
votes
5 answers

PHP/passthru/mysqldump seems to timeout

I've got a PHP script that I call to run MySQL database backups to .sql files, TAR/GZip them and e-mail them to me. One of the database is hosted by a different provider than the one providing the web server. Everything is hosted on Linux/Unix. …
Kevin
  • 21
  • 2
2
votes
1 answer

Running a python script from php with system( ) or even passthru( ) produces no output. Why?

I need to run a python script (a log parser) on hundreds of log files, but I'm a PHP guy so I figured I'd write a little PHP script to grab the list of files from a directory and call the python script dynamically in a foreach loop. I've set…
phpguru
  • 2,241
  • 2
  • 23
  • 30
2
votes
1 answer

how to kill a passthru process upon the kill of a php script?

I'm running a linux command through PHP passthru(), example:
Devon
  • 30,524
  • 9
  • 46
  • 78
2
votes
1 answer

PHP Imagemagick - passthru not working when trying to output a image without saving to the local folder

In the below code , iam trying to output a image through imagemagick processing. Here, iam applying a border radius to the input image. I am getting the output when iam saving a image to the output folder with the following code.
RaviSankar
  • 31
  • 1
  • 2
1
2 3 4 5 6