All Questions
128
questions
-3
votes
1
answer
76
views
What's the go equivalent of reading from php standard input?
I'm porting a PHP script used to listen linux supervisor's events.
It's probably a stupid question, but I cannot understand what is the equivalent of this
$fin = fopen ("php://stdin","r&...
2
votes
1
answer
152
views
stream_select(), signals and Stdin in PHP
I am trying to write a native PHP CLI application which reads data (log data) from stdin and does some handling after.
I got a first working version with a simple while-Loop:
while ($line = fgets(...
2
votes
1
answer
126
views
PHP fgets loads CPU to 100%
I've made read key press function in PHP. The code sets non-block stream mode for STDIN and in while waits when STDIN will receive any data. It works, but I noticed that function loads CPU to 100%. ...
0
votes
1
answer
788
views
Passing STDIN to Ghostscript in PHP proc_open
I want to use Ghostscript command within PHP without writing the input or output in files.
$cmd = "gs -sOutputFile=%stdout% -sDEVICE=pdfwrite -dJOBSERVER -";
$descriptorspec = array(0 => ...
0
votes
2
answers
350
views
How to take an array of size N?
I am working on to improve my coding skill.
So I joined hackerearth to solve coding problems in PHP language because I know PHP.
But on the very first question I got stuck because I don't know how to ...
2
votes
2
answers
430
views
How to take input?
I have started to practice coding problems (hackerearth.com) in PHP to increase my problem-solving skill.
As I saw, most of the coding problems are asked for taking input and then output the correct ...
0
votes
2
answers
367
views
How to execute shell commands from php and do not wait for output on WINDOWS
I have a mask detection python program. Whenever we run that, it keeps running continuously and keeps detecting (endless program). I have made a web portal to start off this python program on a button ...
0
votes
1
answer
2k
views
Fatal error: Uncaught Error: Undefined constant "STDIN" in C:\xampp\htdocs\imagebob\google-drive.php:41
when I try to want access the token the verification code is not working and they give me error undefined constant "STDIN" im new here in google API so please help me what's I do? Thanks
if ...
0
votes
2
answers
235
views
Use input pipe and manage keyboard
I try to run a PHP script which read a flow by incoming pipe, and I want to manage the keyboard too : cat /etc/passwd|./readSlow.php
The script will read each character from pipe and display it slowly ...
0
votes
1
answer
292
views
Apache RewriteMap prg using fopen('php://stdin', 'r') not working over HTTPS
I've set up a RewriteMap using prg which calls a php script, like this:
#!/usr/local/bin/php
<?php
/* DB query generates $map */
$stdout = fopen('php://stdout', 'w');
$stdin = fopen('php://...
2
votes
1
answer
507
views
How to pass the output of command as the input of another?
I'm using a Symfony console application and trying to passed the output of phpstan as the input of my console command:
vendor/bin/phpstan analyse | bin/wte analyse
Currently the commands run as ...
0
votes
2
answers
114
views
PHP script passing email files as STDIN to another PHP parser causing intermittent errors
I have an email script that is parsing bounced emails just fine. Now I have written another script to read all the emails from a particular user account and pass each email file to my parsing script. ...
1
vote
1
answer
349
views
PHP: How to track the timeout of the absence of input data?
There is code which recieves input lines from STDIN:
#!/usr/bin/php
<?php
while (false !== ($line = fgets(STDIN))) {
if (preg_match('/start/',$line)) {
echo $line , "\n";
}
}
...
0
votes
1
answer
411
views
PHP how to read EMAIL from php://input?
Using pipe.php which Converts piped emails to ticket by Peter Rotich (osTicket).
As it says: /* Read the message from STDIN */. The email is being forwarded to this script by an email forwarder in ...
2
votes
0
answers
203
views
PHP CLI: read from stdin but with a timeout
I have a command line PHP script with a loop where at the end of each loop I want to have an option to terminate the script gracefully. Is there a way where I can either...
a) prompt the user for ...