HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   php stdin problem (http://www.howtoforge.com/forums/showthread.php?t=56217)

matej 18th February 2012 10:38

php stdin problem
 
I have quite old server (mandriva "perfect setup", ispconfig 2.0, php version 5.2.5) and I have problem with php (reading from stdin). If I put simple script
Code:

<?php
 echo "Are you sure you want to do this?  Type 'yes' to continue: ";
 $handle = fopen ("php://stdin","r");
 $line = fgets($handle);
 if(trim($line) != 'yes'){
        echo "ABORTING!\n";
        exit;
 }
 echo "\n";
 echo "Thank you, continuing...\n";
 ?>

and execute it through console, I get error:
PHP Warning: fopen(php://stdin): failed to open stream: No such file or directory

I have same php.ini on "similar" server where this works without problem.

Thanks for any idea/hint.

Matej


All times are GMT +2. The time now is 05:27.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.