PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > php.general > Launch vmware server with php script and apache
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Launch vmware server with php script and apache

Réponse
 
LinkBack Outils de la discussion
Vieux 13/03/2008, 17h35   #1
Julio César García Vizcaíno
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Launch vmware server with php script and apache

Hi,

I'm working with a script which must launch vmware server 1.0.3
(Virtualization product) and I can launch it from a terminal:
$php miscript.php
but when I use firefox it just doesn't work.
I've checked the permissions for vmware and the apache user but without
any success.
Can you me what i'm doing wrong?


local.php
------------------------
<?php
echo "Lanzando vmware\n";
system('whoami');
system('/var/www/procesa.pl');
?>
------------------------


procesa.pl
------------------------
#!/usr/bin/perl
system ('/usr/bin/vmware');
------------------------

Sorry for my bad english.

Thanks
--
Julio César GarcÃa VizcaÃno.
FI, UNAM.
Por mi raza hablará el espÃritu

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (GNU/Linux)

iEYEABECAAYFAkfZSc4ACgkQ1fousfD2fZmagwCeOJc0bXMKm2 5VOw5nzU1E/K4N
djUAniVLfo9wcqnrmvvzih05NGbLnD7u
=SgnC
-----END PGP SIGNATURE-----

  Réponse avec citation
Vieux 13/03/2008, 18h01   #2
Daniel Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Launch vmware server with php script and apache

On Thu, Mar 13, 2008 at 11:35 AM, Julio César García Vizcaíno
<fuego216@gmail.com> wrote:
> Hi,
>
> I'm working with a script which must launch vmware server 1.0.3
> (Virtualization product) and I can launch it from a terminal:
> $php miscript.php
> but when I use firefox it just doesn't work.

[snip!]
>
> local.php
> ------------------------
> <?php
> echo "Lanzando vmware\n";
> system('whoami');
> system('/var/www/procesa.pl');
> ?>
> ------------------------


Try rewriting the above as follows:

<?php
error_reporting(E_ALL);
echo "Lanzando vmware\n";
exec('whoami',$who_ret);
exec('/var/www/procesa.pl',$procesa_ret,$err);
echo !isset($argv[0]) ? "<pre />\n" : null;
print_r($who_ret);
print_r($procesa_ret);
echo !isset($argv[0]) ? "</pre>\n" : null;
if(isset($err) && $err != 0) {
echo "Process launching returned error code ".$err."\n";
} else {
echo "Successfully launched!\n";
}
?>

However, I'm not really certain why you need to call the Perl
script. What I would consider doing myself is the following:

<?php
exec('whoami',$who);
echo "Attempting to launch VMWare process as ".$who.".\n";
exec('/usr/bin/vmware & 2>1',$ret,$err);
echo isset($err) && $err != 0 ? "Error code: ".$err."\n" : null;
echo

> Sorry for my bad english.


Your English is better than some of the native speakers we have
here, so no need to apologize! ;-P

--
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283
  Réponse avec citation
Vieux 13/03/2008, 18h52   #3
Daniel Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Launch vmware server with php script and apache

On Thu, Mar 13, 2008 at 12:01 PM, Daniel Brown <parasane@gmail.com> wrote:
> Try rewriting the above as follows:

[code snip]
>
> However, I'm not really certain why you need to call the Perl
> script. What I would consider doing myself is the following:

[code snip]

Sorry, I got jumpy with the Send button and hadn't fixed the rest
of the post before sending. I think that I'm doing too many things at
once.

<?php
exec('whoami',$who);
echo "Attempting to launch VMWare process as ".$who[0].".<br />\n";
exec('/usr/bin/vmware & 2>1',$ret,$err);
echo isset($err) && $err != 0 ? "Error code: ".$err."<br />\n" : null;
echo "Output is as follows:<br />\n";
echo "<pre />\n";
print_r($ret);
echo "</pre>\n";
?>

The error redirect to STDOUT should print out whatever error
messages are being received by the script.

--
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283
  Réponse avec citation
Vieux 13/03/2008, 20h15   #4
Daniel Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [PHP] Launch vmware server with php script and apache

On Thu, Mar 13, 2008 at 1:11 PM, Julio César García Vizcaíno
<fuego216@gmail.com> wrote:
> $tail error.log
> /usr/lib/vmware/bin/vmware: /usr/lib/vmware/lib/libpng12.so.0/libpng12.so.0: no version information available (required by /usr/lib/libcairo.so.2)

[snip!]

This is the first result on Google. Try to STFW with that error
message and it should hopefully you out.

http://communities.vmware.com/message/484981


--
</Daniel P. Brown>
Forensic Services, Senior Unix Engineer
1+ (570-) 362-0283
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 08h38.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11971 seconds with 12 queries