LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 09-15-2006, 01:54 AM   #1
dthai
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
Problem with STDIN.


I try to install Paypal SDK (PHP version), when I run the install.php file, an error was thrown:

Code:
Use of undefined constant STDIN - assumed 'STDIN' in /root/php-sdk/install.php on line 44
PHP Warning:  fgets(): supplied argument is not a valid stream resource in /root/php-sdk/install.php on line 44
The 44th line content is:

Code:
$confirm = strtolower(substr(trim(fgets(STDIN)), 0, 1));
So I think my problem is the STDIN constant of my linux system is missing. How can I install it to my system ? Please help me, thanks very much.

p/s: I use PHP 4.3.10. My system is Fedora Core 2.
 
Old 09-15-2006, 02:22 AM   #2
Nathanael
Member
 
Registered: May 2004
Location: Karlsruhe, Germany
Distribution: debian, gentoo, os x (darwin), ubuntu
Posts: 940

Rep: Reputation: 33
this should actually work on php 4.3+
you could try adding this though at the beginning of the script:
PHP Code:
define('STDIN',fopen("php://stdin","r"));
define('STDOUT',fopen("php://stout","w"));
define('STDERR',fopen("php://sterr","w")); 
http://de3.php.net/manual/en/features.commandline.php is useful!

Last edited by Nathanael; 09-15-2006 at 02:24 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
BASH: Is it possible to take STDIN? microsoft/linux Programming 8 12-30-2011 04:21 PM
mounting from stdin slinky2004 Linux - General 2 03-10-2006 02:33 PM
unbuffered stdin Mike Davies Linux - Software 1 03-03-2006 12:13 AM
stdout stdin Furlinastis Linux - Newbie 3 08-11-2005 11:00 PM
Statistics from stdin? edeca Linux - Software 0 05-23-2005 10:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:12 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration