jogin Posted March 4, 2006 Report Share Posted March 4, 2006 (edited) Nu lūk! Uzrakstīju nelielu daļiņu, lai varētu komandrindu pačibināt. Uz FreeBSD strādā un arī uz Windows būtu jāstrādā. Tipa gāja uz WinXPPro+Apache1.3+PHP4.3.1, bet negāja uz WinXPPro+Apache2+PHP5. Kas varētu būt pa iemeslu? command.php <html> <head><title>komandu interpretators</title> <meta http-equiv="Content-Type" content="text/html; charset=Windows-1257"/> </head> <body> <form enctype="multipart/form-data" action="command.php" method="POST"> Ievadi komandu: <input type="text" name="cmds" /> <input type="submit" value="izpildīt" name="submit"/> </form> <?php $cmds = $_POST['cmds']; if (isset($cmds)) { $cmd = ($cmds." > file.txt"); print "Komanda: ".$cmds."<br/><hr/>"; echo exec($cmd); } else { echo "Kļūda!<br/>"; } echo @passthru($cmds); ?> </body> </html> Edited March 4, 2006 by jogin Link to comment Share on other sites More sharing options...
bubu Posted March 4, 2006 Report Share Posted March 4, 2006 Noņem @ simbolu un uzliec error_reporting E_ALL un display_errors 1, un tad palaid un paskaties, ko saka. Link to comment Share on other sites More sharing options...
jogin Posted March 4, 2006 Author Report Share Posted March 4, 2006 Noņem @ simbolu un uzliec error_reporting E_ALL un display_errors 1, un tad palaid un paskaties, ko saka. Esmu tevis teikto jau izmēģinājis. Man šis skripts pēc komandas izpildes vienkārši bezgalīgi turpina izpildīties un neko neizvada. Citur viss ok. Link to comment Share on other sites More sharing options...
bubu Posted March 4, 2006 Report Share Posted March 4, 2006 Pamēģini aizvākt echo no tās rindiņas. Link to comment Share on other sites More sharing options...
jogin Posted March 4, 2006 Author Report Share Posted March 4, 2006 (edited) Tu zini - nelīdzēja :( Varbūt kaut kas jāpamaina php.ini? Edited March 6, 2006 by jogin Link to comment Share on other sites More sharing options...
Recommended Posts