comand exec not work

Problems with the Windows version of XAMPP, questions, comments, and anything related.

comand exec not work

Postby nasosan » 11. February 2008 14:33

hi,
i have a problem, in a pc whit xampp my page whit exec code, work well, but in other pc not....
whare are the possibile difference?
the version of server are the same, the sistem are home edition sp2+pacth in all pc....

thank's
nasosan
 
Posts: 7
Joined: 11. February 2008 14:29

Postby Wiedmann » 11. February 2008 15:39

but in other pc not....

Why not?
- error message?
- error.log?
- piece of (real) example code which is not working?
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby nasosan » 11. February 2008 15:45

Wiedmann wrote:
but in other pc not....

Why not?
- error message?
- error.log?
- piece of (real) example code which is not working?

is this the problem.... i dont know why....
the page, load in pc a work and load putty.exe....
the same page, the same site... in pc b, dosent work, and it dont make error message, error log or other.. it load.... and noting...

i have the same version of xampp, 22. Mai 2007 XAMPP 1.6.2 Beta 3 into all pc...

for the code, now i dont have it....
i have the necessity to make a button that load putty session... and reload the page...
nasosan
 
Posts: 7
Joined: 11. February 2008 14:29

Postby nasosan » 12. February 2008 11:19

what block the exec istruction?

the code are
Code: Select all
<head>
<meta http-equiv="Refresh" content="0; url=cronometri.php">
</head>
<?
$cartella="c:/xampp/htdocs/";//percorso  iniziale
$cartella2="test/";//cartella temporanea
$sottocartella="pc".strtolower($chi)."/";//sottocartella per ogni pc
$file="putty";//nome file
$win=".bat";//estensione x windows
$pulisci=$cartella.$cartella2.$sottocartella.$file.$win;//percorso completo
exec($pulisci);//esegui file
?>



and in other pc works wery fine!!! :'( help me....

ps
i'm italian.. and not write english.... excuse me...

arips
i have retest the prg... and not work.... work only if i use other pc... (server and prg into the same pc)
i have pc a=server and prg works fine
server=pc a and prg on pc b not work
server pc b and prg pc b not work
server pc b and prg pc a not work

:'(
nasosan
 
Posts: 7
Joined: 11. February 2008 14:29

Postby Wiedmann » 12. February 2008 12:16

For debugging....

change:
Code: Select all
<meta http-equiv="Refresh" content="0; url=cronometri.php">

to:
Code: Select all
<!-- <meta http-equiv="Refresh" content="0; url=cronometri.php"> -->


and:
Code: Select all
<?

to:
Code: Select all
<?php
error_reporting(E_ALL);


and:
Code: Select all
exec($pulisci);//esegui file

to:
Code: Select all
exec($pulisci, $output, $return_var);//esegui file
echo '<pre>'.PHP_EOL;
var_dump($output);
var_dump($return_var);
echo '</pre>'.PHP_EOL;
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby nasosan » 12. February 2008 12:31

thanks!
i have made modify, but the page are waiting for localhost.................

dosent write nothing.....

there is this one the problem....
if i start the same page on other pc.. the result are:
Code: Select all
array(2) {
  [0]=>
  string(0) ""
  [1]=>
  string(47) "C:\xampp\htdocs\test>start putty.exe -load NSS1"
}
int(0)

and i see the putty windows that request psw..... i close this windows and compare the code....

the prg putty.exe are in all pc on windows directory...

ps
if i start the $pulisci (file....) directly from windows it work fine.... but start to php page, not........
nasosan
 
Posts: 7
Joined: 11. February 2008 14:29

Postby Wiedmann » 12. February 2008 13:20

i have made modify, but the page are waiting for localhost.................

a) this also happens, if you disable/delete the line with "exec(...)"?

BTW:
and i see the putty windows that request psw..... i close this windows

If you must close the putty window by your own, this code can only work if server and client is the same pc... And of course: If you start Apache as service, you can't see such a window in a normal installation.
Wiedmann
AF Moderator
 
Posts: 17106
Joined: 01. February 2004 12:38
Location: Stuttgart / Germany

Postby nasosan » 12. February 2008 21:30

Wiedmann wrote:
i have made modify, but the page are waiting for localhost.................

a) this also happens, if you disable/delete the line with "exec(...)"?

i test it tomorrow... but if i remember the page work fine...
BTW:
and i see the putty windows that request psw..... i close this windows

If you must close the putty window by your own, this code can only work if server and client is the same pc... And of course: If you start Apache as service, you can't see such a window in a normal installation.

in pc whit "error" the server apache is on service.... i disable it tomorrow and test......
thanks!!! you have save my life :D (if the error is this...... ;) )

ps
is possible (i dont remember) to start apache and mysql in automatic?
nasosan
 
Posts: 7
Joined: 11. February 2008 14:29


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 79 guests