angelov has asked for the wisdom of the Perl Monks concerning the following question:
When I try and call the routine from PHP - via the exec(), shell_exec() or system() function - the routine doesn't work. The issue I am seeing - when spawning the routine from PHP is that the INPUT BUFFER (where the MATCH occurs) does not seem to "fully" update with the data received from the server I am logging into.
Example: Running routine from PHP - this is the output produced with EXP_INTERNAL set to "1":Same routine from UNIX shell - this is the output produced with EXP_INTERNAL set to "1": (this is the expected output)spawn id(5): Does `Trying 10.13.81.123...\r\r\nConnected to coveaux.at +m.ca (10.13.81.123).\r\r\nEscape character is \'^]\' .\r\r\n' match: pattern #1: -re `login:'? No. Waiting for new data (50 seconds)... TIMEOUT
Can anyone provide some help -- identifying any further debugging or a hint as to what could be happening.spawn id(3): Does `Trying 10.13.81.123...\r\r\nConnected to coveaux.at +m.ca (10.13.81.123).\r\r\nEscape character is \'^]\'.\r\r\n\r\n\r\nSu +nOS 5.8\r\n\r\r\n\r+------------------------------------------------- +----------------------+\r\n| WARNING + |\r\n| -- +----- |\r\n| + |\r\n| The programs and + data stored on this system are licensed to or are |\r\n| private +property of this company and are lawfully available only to |\r\n| +authorized users for approved purposes. Unauthorized access to any + |\r\n| program or data on this system is not permitted, and any unau +thorized |\r\n| access beyond this point may lead to prosecution. Thi +s system may be |\r\n| monitored at any time for operational reasons +, therefore, if you are |\r\n| not an authorized user, + |\r\n| DO NOT ATTEMPT TO LOG IN. + |\r\n| + |\r\n| + Avertissement |\r\n| + ------------- |\r\ +n| + |\r\n| Les programmes et les données stockés dans ce système sont + visés par |\r\n| une licence ou sont propriété privée de cette comp +agnie et ils ne sont|\r\n| accessibles légalement qu\'aux usagers aut +orisés a des fins autorisées.|\r\n| Il est interdit d\'y accéder sans + autorisation, et tout accès non |\r\n| autorisé au dela de ce p +oint peut entrainer des poursuites. Le système|\r\n| peut en tout tem +ps faire l\'objet d\'une surveillance. Si vous n\'êtes |\r\n| pas u +n usager autorisé, |\r\ +n| N\'ESSAYEZ PAS D\'Y ACCÉDER. + |\r\n+--------------------------------------------------------- +--------------+\r\nlogin: ' match: pattern #1: -re `login:'? YES!!
Platform routine is running on: Solaris 10, running PERL 5.8.7 with appropriate libraries. Expect.pm module -> V1.20 Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.8b PHP/5.2.5
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: PHP with PERL EXPECT
by Anonymous Monk on Mar 14, 2008 at 03:27 UTC |